Followup to #361 (which I meant to look at but forgot).
Instead of parsing the JSON input into a serde::Value we can use serde-transcode to serialize straight from the input to the output. On an articial very large JSON file I use for testing this ends up five times faster. (Maybe slightly faster than jsonxf was?) I got this trick from jsonxf's serde benchmark.
(The rest of the PR looked great. Thanks, @zuisong!)
I also included a tiny theoretical bugfix for decompression that I wrote a while ago but didn't think was worth a PR, see the explanation in 398d5673800d06c06b39b91f24a097864b83679a
Followup to #361 (which I meant to look at but forgot).
Instead of parsing the JSON input into a
serde::Value
we can useserde-transcode
to serialize straight from the input to the output. On an articial very large JSON file I use for testing this ends up five times faster. (Maybe slightly faster thanjsonxf
was?) I got this trick from jsonxf's serde benchmark.(The rest of the PR looked great. Thanks, @zuisong!)
I also included a tiny theoretical bugfix for decompression that I wrote a while ago but didn't think was worth a PR, see the explanation in 398d5673800d06c06b39b91f24a097864b83679a