A simple ASCII-only JSON parser

in #cplusplus2 years ago

I've written a simple ASCII-only JSON parser in C++, rust, ocaml and standardml.
https://github.com/serpent7776/json-parse

Here's some quick stats:
Non-empty lines of code (including tests), time parsing a single ~90MB JSON, time parsing 13 JSON files of varying sizes, peak heap usage, total bytes allocated.
Note that the code wasn't written with performance in mind.

c++rustocamlsml
lines902604546528
time parsing 1 json [s]1.4760.6831.6372.300
time parsing all jsons [s]5.5602.7356.3267.716
peak heap [MB]589.4388.2317.6N/A
total allocated [B]1,074,494,993598,650,503335,248,296N/A