Closed stephenberry closed 6 months ago
Do you mean to say that it's not serializing json in the process of prettifying? I thought that's what was meant by prettifying json data - going from a string of minified json data to a string of prettified json data, which is also what is being done with glaze in the benchmarks - is it not?
The benchmarks do test glz::prettify_json
on a string buffer. But, often a user will want to generate prettified JSON directly from the C++ objects, just like how we read JSON directly into C++ objects. Glaze offers glz::write<glz::opts{.prettify = true}>(obj, buffer);
, which will directly convert the C++ object into prettified JSON.
Right now your tests using objects under ... (Prettified) Results
don't actually write out prettified JSON. They write out minified JSON.
What is meant by "Prettified" is that the input json data is prettified.
Right, but you're just doing two of the same tests when you could also be testing the prettified write performance.
Alright thanks. I've updated Jsonifier to be able to directly write as prettified data as well as modified the benchmarks to reflect this as well as set it up so that glaze would also be tested in the same way.
Awesome! Thanks!
Prettified write performance in the benchmarks doesn't make sense to me, because it doesn't actually seem to be writing prettified data.
Glaze has built in support to write prettified data, but I don't think Jsonifier can. Jsonifier could call its prettify method after calling write, but this would be two steps and probably much slower.