|
Boost : |
From: Christian Mazakas (christian.mazakas_at_[hidden])
Date: 2024-02-29 23:14:15
> It is up to you. I think Zach would appreciate knowing if there was a
> significant performance issue with the library.
Fwiw, there is a dramatic performance penalty to using this library and I
almost
couldn't believe it.
I copy-pasted the JSON example from the Parser repo and then did an
informal comparison
to Boost.JSON.
For one, Boost.JSON should just export a proper CMake target like all the
other compiled Boost
libraries.
And then two, these were my findings:
⯠./__build__/test/json_bench
/home/exbigboss/cpp/boost-root/libs/json/bench/data/twitter.json
Boost.Parser
took: 1037ms
parse successful! 1
Boost.JSON
took: 1ms
parse successful! 1
Source: https://github.com/cmazakas/parser-review/blob/main/test/json.cpp
I'm running all of this on a 3.6 GHz 12 core with 32 GB of RAM. I'm
honestly shocked that
it takes Boost.JSON roughly 1ms whereas it takes roughly 1000x that with
Parser.
I will note this, I did have to increase the recursion limit so I'm
thinking this is actually more or
less a fault in the implementation of the recursive parsing rules in
Parser. Either way, this is 112%
worth investigating and I'd almost recommend halting acceptance until we
sort this out.
- Christian
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk