mapbox / mapbox/geobuf

Encoding about as slow as `JSON.stringify`

Open
#119 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1k
Forks
86
PR merge metrics
No merged PRs in 30d

Description

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)*

Contributor guide

Open the contributing guide

Research direction

Start by constructing a representative GeoJSON case from the use case described in the linked MapLibre issue, then benchmark geobuf.encode against JSON.stringify in Chrome and other browsers. Done means the comparison is reproducible and shows whether the README performance claim should be revised or the encoding implementation investigated.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.