GithubHelp home page GithubHelp logo

isabella232 / json-benchmark Goto Github PK

View Code? Open in Web Editor NEW

This project forked from serde-rs/json-benchmark

0.0 0.0 0.0 1.13 MB

nativejson-benchmark in Rust

License: Apache License 2.0

Rust 13.57% JavaScript 0.45% HTML 0.40% Makefile 0.02% C++ 82.22% C 3.34%

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         280 MB/s   370 MB/s   510 MB/s   320 MB/s
data/citm_catalog.json   400 MB/s   420 MB/s   840 MB/s   660 MB/s
data/twitter.json        270 MB/s   730 MB/s   530 MB/s   850 MB/s

======= json-rust ======== parse|stringify ===== parse|stringify ====
data/canada.json         270 MB/s   830 MB/s
data/citm_catalog.json   550 MB/s   700 MB/s
data/twitter.json        410 MB/s   900 MB/s

==== rustc_serialize ===== parse|stringify ===== parse|stringify ====
data/canada.json         150 MB/s    65 MB/s   110 MB/s    45 MB/s
data/citm_catalog.json   180 MB/s   180 MB/s   130 MB/s   210 MB/s
data/twitter.json         99 MB/s   320 MB/s    75 MB/s   350 MB/s

======= simd-json ======== parse|stringify ===== parse|stringify ====
data/canada.json         350 MB/s   420 MB/s   580 MB/s
data/citm_catalog.json   820 MB/s   590 MB/s  1290 MB/s
data/twitter.json        660 MB/s   740 MB/s   900 MB/s
  • Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz (laptop CPU from 2015)
  • rustc 1.46.0-nightly (118b50524 2020-06-06)

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.