-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ujson for serializing GeoJSON and TopoJSON #143
Conversation
Nice work! I was expecting a similar (or slightly smaller) improvement in MVT generation since it first has to calculate the JSON version. Does that mean most the savings here is JSON > String > file IO related changes? |
Please also link up related PR for |
My measurements here are for the runtime of the |
@nvkelso said:
A tileserver PR would just be an adjustment of the |
We declare And we |
To observe the expected MVT format times improvement, I suspect you'd additionally need to measure the total time tileserver took to generate the example tiles per format (not just the |
Yep, it looks like tileserver does the JSON decoding stuff here. |
It should be removed from all requirements files.
Some of that, if not all, was a vestige of when tileserver handled custom layer requests. There's an issue for cleaning that up. |
I checked before and after "landuse":{"type":"FeatureCollection","features":[]}} whereas the built-in JSON serializer includes whitespace: "landuse": {"type": "FeatureCollection", "features": []}} |
For #139.
simplejson
was merged into Python core in 2.6, so there's actually a slow-down using simplejson 3.6.4 (which is currently installed, but unused) or 3.10.0 (the latest version):Built-in
simplejson
3.6.4simplejson
3.10.0As a result, this pull request switches to use
ujson
, a faster (but less feature-rich) JSON library. It seems to shave 10-20% of time:Built-in
ujson
1.35ujson
resulted in a < 2% difference for the mvt and mvtb formats.