Boost logo

Boost :

From: Hadriel Kaplan (hadrielk_at_[hidden])
Date: 2020-09-21 01:26:34


> On Sep 20, 2020, at 9:19 PM, Vinnie Falco <vinnie.falco_at_[hidden]> wrote:
>
> The algorithm first tries to fit the output into a local 4kb stack
> buffer. For serialized JSONS smaller than this size it should result
> in a std::string that allocates only what is needed. I am guessing
> that your serialized JSONs are larger (or else the resulting string
> would be perfectly sized).

Yeah it was several hundred MB in the test I was trying.

> The library implementation tries to provide good general purpose
> performance but there will always be use-cases that it handles
> sub-optimally. If you have additional information about your typical
> JSONs, you might see a benefit to writing your own string conversion
> algorithm by making a copy of the `serialize_impl` function and
> adjusting its heuristics to better match your data. This is precisely
> why `json::serializer` is exposed as a public interface.

Nice. Thanks!

-hadriel


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