Giter Club home page Giter Club logo

json-benchmark's Introduction

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

======= json-rust ======== parse|stringify ===== parse|stringify ====
data/canada.json         390 MB/s   840 MB/s
data/citm_catalog.json   520 MB/s   780 MB/s
data/twitter.json        430 MB/s  1030 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
  • Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz (laptop CPU from 2015)
  • rustc 1.59.0-nightly (0b6f079e4 2021-12-07)

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
  • clang version 11.0.0-++20200128080810+b96e6859c99-1exp120200128191406.2758
  • gcc version 10.1.0 (Ubuntu 10.1.0-2ubuntu1~18.04)

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
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.

json-benchmark's People

Contributors

dtolnay avatar licenser avatar maciejhirsz avatar skade avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.