4 ms·
Not Rust, but for C++ I have found a lot of memory and CPU perf can be realized by knowing what is being parsed into and using that. Most JSON parsing optimiz
by beached_whale 5y ago
Not Rust, but for C++ I have found a lot of memory and CPU perf can be realized by knowing what is being parsed into and using that. Most JSON parsing optimize on array/object/number/bool/null and not things like unsigned integer being much faster to parse than a float(floating point hit cpu bottlenecks around 1GB/s). Additionally, allowing for compile time options to further optimize is much easier. Essentially most JSON parsers are type erased. https://github.com/beached/daw_json_link https://github.com/beached/daw_json_link
So this correlates with some of the findings the post has. One optimization that should show great promise is that if one knows that they have an array of some types like numbers/unsigned int/strings, that can greatly simplify and allow for SIMD'ification of it.
- leni536 5y agoCheck out https://github.com/beached/daw_json_link https://github.com/beached/daw_json_link , it provides a non-typeerased way to parse JSON straight into user-defined data structures.
- beached_whale 5y agoIm the author :)
- leni536 5y agoOh, lol, didn't check the name there, and didn't through the whole comment either.