-
I have to commend on the simplicity and clarity of thought in the write up. I could see what you were up to just by a skim through it (also thanks for the ready reference)!
I'm pretty sure you'd already know of this, but once you've written your own version, it might help to compare and take notes from a popular, well-established, benchmarked library: https://github.com/serde-rs/json.
-
Stream
Stream - Scalable APIs for Chat, Feeds, Moderation, & Video. Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.
-
I need to work on my rust JSON parser some more[0]. I intended it handle deeply nested (malicious) objects gracefully and with little memory allocations. It's also pretty fast.
I had a goal of making it "async", so it could periodically yield for large input strings, but I'm not so sure it matters much.
Currently the API is pretty impractical to use, because of the arena structure that is set up. It could be improved
[0] https://github.com/conradludgate/sonny-jim
-
Regarding the 'sudo' issue: Doing a benchmark by just running an example executable is not really recommended because there's a ton of reasons why you might get differing performance.
It's probably better to set up an actual benchmark using a crate like Criterion instead [0].
[0] https://github.com/bheisler/criterion.rs
-
-
-
And on a related note, this project was for educational purposes, but if the author wants to do more parsing in Rust, there's the excellent `nom` crate [1], which provides a JSON parser as an example [2].
It uses a very similar paradigm to what the author used in the article, and provides a lot of helper utilities. I used it to parse a (very, very small) subset of Markdown recently [3] and enjoyed the experience.
[1] https://github.com/rust-bakery/nom
[2] https://github.com/rust-bakery/nom/blob/main/examples/json.r...
[3] https://git.sr.ht/~bsprague/logseq-to-linkwarden
-
I changed it to use Cow, performance improved from 121.02 MB/s to 278.66 MB/s
https://github.com/rectalogic/jsonparser
-
InfluxDB
InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
-
That sounds a little like what I came up with a little while back. My lib can stream JSON to/from my own compact binary format that is easy to traverse/emit in C:
https://github.com/nwpierce/jsb/