-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Clean libosrm from concepts and dependencies external to library's design #2029
Comments
I don't know what you are getting here on. We need a way to represent the response. We either come up with a C++ structure that encapsulates our response, but in that case we then need to write an additional translation layer that transforms the C++ API structutre to the JSON API structure. This is unneeded overhead and we optimize for our use case - direct mapping to JS structures.
Yes this is why |
Bumping this issue in light of our recent findings: assembling the JSON object / variant is heavy on the allocator. Quick fix would be to try a pool allocator or link in e.g. jemalloc if it's found on the user's system. What are our long-term plans for fixing this? |
@daniel-j-h I did an experiment with a custom Long term I would like to explore the option of dropping the internal JSON for
Since this would mean OSRM 6 I want to be sure we have a very good idea what this would mean on the performance side and impact of code reuse. |
I think we should explore this even before breaking the API for this. Once #3768 lands it is easier to refactor where something is converted to JSON/V8 or just plain structs. This would basically need an abstraction layer that works on the plain C++ struct version and exports the same format that we are currently exposing.
|
This issue seems to be stale. It will be closed in 30 days if no further activity occurs. |
In the strict sense libosrm does not need to know about responses being encoded as JSON or hints being encoded in Base64.
JSON is only needed for the HTTP use-case we have e.g. with node-osrm. Why not build node-osrm completely on top of libosrm? A libosrm user neither needs JSON nor the variant dependency it comes with.
The same goes for the hint. The requirement for Base64 encoding comes from the HTTP use-case and is not inherent in libosrm. Using libosrm I am able to store a Hint-typed object just fine.
Feel free to discuss.
The text was updated successfully, but these errors were encountered: