Zach Laine wrote:
Thanks. I fixed it as well, and now I get about 1.5-2X worse performance than Boost.JSON. I'm just building the "pretty" example from Boost.JSON, and "json" and "callback_json" from my examples. When I feed these the file at https://world.openfoodfacts.org/api/v0/product/5060292302201.json , and prepend "time", I get these results:
pretty (Boost.JSON): real 0m0.014s user 0m0.004s sys 0m0.000s
json (Parser): real 0m0.022s user 0m0.020s sys 0m0.000s
callback_json (Parser, no JSON object creation): real 0m0.023s user 0m0.018s sys 0m0.004s
I'm not sure what the tests reported earlier were doing, but I definitely don't see orders of magnitude difference.
I used this file: https://github.com/boostorg/json/blob/develop/bench/data/twitter.json