Home

Awesome

Rust JSON Benchmark

This is a partial port of nativejson-benchmark to Rust. The libraries tested are:

$ cargo run --release

                                DOM                STRUCT
======= serde_json ======= parse|stringify ===== parse|stringify ====
data/canada.json         320 MB/s   430 MB/s   580 MB/s   310 MB/s
data/citm_catalog.json   420 MB/s   560 MB/s   710 MB/s   880 MB/s
data/twitter.json        300 MB/s   910 MB/s   550 MB/s  1060 MB/s

==== rustc_serialize ===== parse|stringify ===== parse|stringify ====
data/canada.json         150 MB/s    67 MB/s   120 MB/s    46 MB/s
data/citm_catalog.json   210 MB/s   180 MB/s   140 MB/s   210 MB/s
data/twitter.json        120 MB/s   330 MB/s    87 MB/s   350 MB/s

======= simd-json ======== parse|stringify ===== parse|stringify ====
data/canada.json         380 MB/s   470 MB/s   580 MB/s
data/citm_catalog.json   720 MB/s   760 MB/s  1220 MB/s
data/twitter.json        810 MB/s   890 MB/s  1050 MB/s

To update the numbers above, I run ./json-benchmark twice on an otherwise idle computer and take the greater of the two results for each number.

For comparison, here are results from RapidJSON on the same hardware with the nativejson-benchmark modified to run 256 times instead of 10. Code is in the cpp directory of this repo.

==== rapidjson-clang ===================== parse|stringify ====
data/canada.json                         380 MB/s   200 MB/s
data/citm_catalog.json                   680 MB/s  1090 MB/s
data/twitter.json                        320 MB/s   600 MB/s

===== rapidjson-gcc ====================== parse|stringify ====
data/canada.json                         390 MB/s   250 MB/s
data/citm_catalog.json                   890 MB/s  1650 MB/s
data/twitter.json                        440 MB/s   870 MB/s
<br>

License

<sup> Licensed under either of <a href="LICENSE-APACHE">Apache License, Version 2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option. </sup> <br> <sub> Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. </sub>