Published: 25 Nov 2022 › Updated: 25 Nov 2022

A simple ASCII-only JSON parser
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++ | rust | ocaml | sml | |
|---|---|---|---|---|
| lines | 902 | 604 | 546 | 528 |
| time parsing 1 json [s] | 1.476 | 0.683 | 1.637 | 2.300 |
| time parsing all jsons [s] | 5.560 | 2.735 | 6.326 | 7.716 |
| peak heap [MB] | 589.4 | 388.2 | 317.6 | N/A |
| total allocated [B] | 1,074,494,993 | 598,650,503 | 335,248,296 | N/A |
Leave A simple ASCII-only JSON parser to:
Read more #cplusplus posts
Best Posts From Serpent7776
We have not curated any of serpent7776's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.