Boost logo

Boost :

From: Zach Laine (whatwasthataddress_at_[hidden])
Date: 2024-03-01 00:44:52


On Thu, Feb 29, 2024 at 5:14 PM Christian Mazakas via Boost
<boost_at_[hidden]> wrote:
>
> > 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.

I'm shocked too. That's really crazy. Believe me, I'm not interested
in merging something with orders of magnitude of perf overhead into
Boost. I will be getting to the bottom of this long before a merge
could take place.

Zach


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk