mapbox / geobuf

A compact binary encoding for geographic data.
ISC License
967 stars 84 forks source link

Encoding about as slow as `JSON.stringify` #119

Open JannikGM opened 3 years ago

JannikGM commented 3 years ago

Consider this a companion for #114 to also challenge this claim from the README (and the similar claim from the pbf README):

Very fast encoding and decoding — even faster than native JSON parse/stringify.


Namely, this is our use-case: https://github.com/maplibre/maplibre-gl-js/issues/106#issuecomment-802834969

In Chrome, for me, JSON.stringify and geobuf.encode, seem to take about ~200ms each. I did not try other browsers yet.

(Unfortunately I can't share my actual GeoJSON, but if we decide to move forward with trying to make geobuf work for us, then I'll likely construct a similar test case; our GeoJSON is described in the linked issue though)