jorgen / json_struct

json_struct is a single header only C++ library for parsing JSON directly to C++ structs and vice versa
Other
422 stars 57 forks source link

Could be useful to consider the On Demand API #7

Closed lemire closed 4 years ago

lemire commented 4 years ago

This is maybe of interest to you... https://github.com/simdjson/simdjson/blob/master/doc/ondemand.md

jorgen commented 4 years ago

Yes, I saw this mentioned on reddit! If you squint your eyes, this is similar to how json_struct does this aldrady. json_struct doesn't use a DOM as an intermediate step, but goes directly from tokens to structs/types. I have to check out what the performance difference is now with the new api, but I expect it to be about the same if all the members in the struct is converted into the domain specific type, and simdjson performing even better in the case only 1 member should be populated. I could probably implement the tokenizer api on top of simdjson token api? But I'm affraid it would take some of the fun out of the project for me.

BTW: I'm a keen reader of your blog posts 👍

lemire commented 4 years ago

This was merely meant as a pointer. :-)

It is a cool project.