Skip to content
nativejson-benchmark in Rust
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
binary Move binary benchmark to its own crate Mar 23, 2019
cpp Add sax handling for canada.json May 10, 2017
data JSON benchmark Jul 1, 2016
json.rs
src Move binary benchmark to its own crate Mar 23, 2019
.gitignore
.travis.yml Update Travis commands for new project structure Mar 23, 2019
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
README.md Move binary benchmark to its own crate Mar 23, 2019

README.md

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         200 MB/s   400 MB/s   550 MB/s   320 MB/s
data/citm_catalog.json   300 MB/s   390 MB/s   840 MB/s   820 MB/s
data/twitter.json        260 MB/s   860 MB/s   540 MB/s   930 MB/s

======= json-rust ======== parse|stringify ===== parse|stringify ====
data/canada.json         280 MB/s   850 MB/s
data/citm_catalog.json   580 MB/s   720 MB/s
data/twitter.json        420 MB/s   910 MB/s

==== rustc_serialize ===== parse|stringify ===== parse|stringify ====
data/canada.json         120 MB/s    62 MB/s    89 MB/s    44 MB/s
data/citm_catalog.json   120 MB/s   150 MB/s   100 MB/s   190 MB/s
data/twitter.json         84 MB/s   310 MB/s    64 MB/s   330 MB/s
  • Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz (laptop CPU from 2015)
  • rustc 1.35.0-nightly (cb2f34dc6 2019-03-22)

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.

==== rapidjson-clang ===================== parse|stringify ====
data/canada.json                         390 MB/s   200 MB/s
data/citm_catalog.json                   670 MB/s   290 MB/s
data/twitter.json                        340 MB/s   370 MB/s

===== rapidjson-gcc ====================== parse|stringify ====
data/canada.json                         470 MB/s   240 MB/s
data/citm_catalog.json                   990 MB/s   480 MB/s
data/twitter.json                        470 MB/s   620 MB/s
  • clang version 3.8.0
  • gcc version 5.4.0
You can’t perform that action at this time.