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
Investigate parsing into user structures directly #627
Comments
I made a prototype, https://gist.github.com/pdimov/bcdaa4fef606fdcd0f21195a79bf8648 Unfortunately it's slower. But still cooler. :-)
|
The manual loop, parsing via the JSON DOM is not performing error-checking on the types in the DOM. It'll exhibit UB if the JSON is valid but not correctly representing the co-ordinate array, so I think it's getting a better score than it should. |
It's copied from the benchmark code. This needs to be refactored to contain the subhandlers inline in the composite handlers, rather than allocating them with |
Also needs a handler for ( |
https://gist.github.com/pdimov/c74627565d35cdff97d7f4d0ae7a7b00 This one is faster.
|
It needs its own suite of parsing functions, e.g.
Using pull-parsing with this signature
|
|
|
E.g.
where
X
is something that Boost.Json recognizes, such as a struct withvalue_to
defined, or (given #626) a described struct.As an example of why this is useful, on one popular benchmark
https://github.com/kostya/benchmarks#json
https://github.com/kostya/benchmarks/blob/master/json/test_boost_json.cpp
having the ability to parse directly into either
std::vector<coordinate>
or a custom container that accumulates in itspush_back
member function instead of storing the elements could potentially gain a lot of performance.The text was updated successfully, but these errors were encountered: