I am loading a geojson file of full US Zipcodes over an ajax request, before I was using plain json, I now change it to use geobuf. So I replace the JSON.parse() by a geobuf.decode().
The document says it should be faster:
even faster than native JSON parse/stringify.
However now it is actualy 2 seconds slower.
var req = new XMLHttpRequest();
req.responseType = "arraybuffer";
req.addEventListener("load", function () {
//var featureCollection = JSON.parse(this.responseText); // Took arround 4s
var featureCollection = geobuf.decode(new Pbf(this.response)); // takes arround 6s
//...
});
req.open("GET", url);
req.send();
Am I doing something wrong or is there any way to improve it?
I am loading a geojson file of full US Zipcodes over an ajax request, before I was using plain json, I now change it to use geobuf. So I replace the JSON.parse() by a geobuf.decode().
The document says it should be faster:
However now it is actualy 2 seconds slower.
Am I doing something wrong or is there any way to improve it?