Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

simdjson

> 编程语言
Open source

Parsing gigabytes of JSON per second : used by Facebook/Meta Velox, the Node.js runtime, ClickHouse, WatermelonDB, Apache Doris, Milvus, StarRocks

24.1K stars0 likes4 views
WebsiteGitHub

About

Parsing gigabytes of JSON per second : used by Facebook/Meta Velox, the Node.js runtime, ClickHouse, WatermelonDB, Apache Doris, Milvus, StarRocks

simdjson : Parsing gigabytes of JSON per second

JSON is everywhere on the Internet. Servers spend a lot of time parsing it. We need a fresh approach. The simdjson library uses commonly available SIMD instructions and microparallel algorithms to parse JSON 4x faster than RapidJSON and 25x faster than JSON for Modern C++.

  • Fast: Over 4x faster than commonly used production-grade JSON parsers.
  • Record Breaking Features: Minify JSON at 6 GB/s, validate UTF-8 at 13 GB/s, NDJSON at 3.5 GB/s.
  • Easy: First-class, easy to use and carefully documented APIs.
  • Strict: Full JSON and UTF-8 validation, lossless parsing. Performance with no compromises.
  • Automatic: Selects a CPU-tailored parser at runtime. No configuration needed.
  • Reliable: From memory allocation to error handling, simdjson's design avoids surprises.
  • Peer Reviewed: Our research appears in venues like VLDB Journal, Software: Practice and Experience.

This library is part of the Awesome Modern C++ list.

Table of Contents

  • Real-world usage
  • Quick Start
  • Documentation
  • Godbolt
  • Performance results
  • Packages
  • Bindings and Ports of simdjson
  • About simdjson
  • Funding
  • Contributing to simdjson
  • License

Real-world usage

  • Node.js
  • ClickHouse
  • Meta Velox
  • Google Pax
  • milvus
  • QuestDB
  • Clang Build Analyzer
  • Shopify HeapProfiler
  • StarRocks
  • Microsoft FishStore
  • Intel PCM
  • WatermelonDB
  • Apache Doris
  • Dgraph
  • UCall
  • fastgltf
  • tenzir
  • ada-url
  • fastgron
  • WasmEdge
  • RonDB
  • GreptimeDB
  • mamba
  • Ladybird Browser
  • SereneDB

If you are planning to use simdjson in a product, please work from one of our releases.

Quick Start

The simdjson library is easily consumable with a single .h and .cpp file.

  1. Prerequisites: g++ (version 7 or better) or clang++ (version 6 or better), and a 64-bit system with a command-line shell (e.g., Linux, macOS, freeBSD). We also support programming environments like Visual Studio and Xcode, but different steps are needed. Users of clang++ may need to specify the C++ version (e.g., c++ -std=c++17) since clang++ tends to default on C++98.

  2. Pull simdjson.h and simdjson.cpp into a directory, along with the sample file twitter.json. You can download them with the wget utility:

    bash
    wget https://raw.githubusercontent.com/simdjson/simdjson/master/singleheader/simdjson.h https://raw.githubusercontent.com/simdjson/simdjson/master/singleheader/simdjson.cpp https://raw.githubusercontent.com/simdjson/simdjson/master/jsonexamples/twitter.json
  3. Create quickstart.cpp:

cpp
#include <iostream>
#include "simdjson.h"
using namespace simdjson;
int main(void) {
    ondemand::parser parser;
    padded_string json = padded_string::load("twitter.json");
    ondemand::document tweets = parser.iterate(json);
    std::cout << uint64_t(tweets["search_metadata"]["count"]) << " results." << std::endl;
}
  1. c++ -o quickstart quickstart.cpp simdjson.cpp
  2. ./quickstart
 100 results.

Documentation

Usage documentation is available:

  • Basics is an overview of how to use simdjson and its APIs.
  • Builder is an overview of how to efficiently write JSON strings using simdjson.
  • Performance shows some more advanced scenarios and how to tune for them.
  • Implementation Selection describes runtime CPU detection and how you can work with it.
  • API contains the automatically generated API documentation.
  • Compile-Time Parsing presents our compile-time parsing function (C++26 only).

Godbolt

Some users may want to browse code along with the compiled assembly. You want to check out the following lists of examples:

  • C++26 reflection example
  • simdjson examples with errors handled through exceptions
  • simdjson examples with errors without exceptions

Performance results

The simdjson library uses three-quarters less instructions than state-of-the-art parser RapidJSON. To our knowledge, simdjson is the first fully-validating JSON parser to run at gigabytes per second (GB/s) on commodity processors. It can parse millions of JSON documents per second on a single core.

The following figure represents parsing speed in GB/s for parsing various files on an Intel Skylake processor (3.4 GHz) using the GNU GCC 10 compiler (with the -O3 flag). We compare against the best and fastest C++ libraries on benchmarks that load and process the data. The simdjson library offers full unicode (UTF-8) validation and exact number parsing.

The simdjson library offers high speed whether it processes tiny files (e.g., 300 bytes) or larger files (e.g., 3MB). The following plot presents parsing speed for synthetic files over various sizes generated with a script on a 3.4 GHz Skylake processor (GNU GCC 9, -O3).

All our experiments are reproducible.

For NDJSON files, we can exceed 3 GB/s with our multithreaded parsing functions.

Packages

Bindings and Ports of simdjson

We distinguish between "bindings" (which just wrap the C++ code) and a port to another programming language (which reimplements everything).

  • ZippyJSON: Swift bindings for the simdjson project.
  • libpy_simdjson: high-speed Python bindings for simdjson using libpy.
  • pysimdjson: Python bindings for the simdjson project.
  • cysimdjson: high-speed Python bindings for the simdjson project.
  • simdjson-rs: Rust port.
  • simdjson-rust: Rust wrapper (bindings).
  • SimdJsonSharp: C# version for .NET Core (bindings and full port).
  • simdjson_nodejs: Node.js bindings for the simdjson project.
  • simdjson_php: PHP bindings for the simdjson project.
  • simdjson_ruby: Ruby bindings for the simdjson project.
  • fast_jsonparser: Ruby bindings for the simdjson project.
  • simdjson-go: Go port using Golang assembly.
  • rcppsimdjson: R bindings.
  • simdjson_erlang: erlang bindings.
  • simdjsone: erlang bindings.
  • lua-simdjson: lua bindings.
  • hermes-json: haskell bindings.
  • zimdjson: Zig port.
  • simdjzon: Zig port.
  • JSON-Simd: Raku bindings.
  • JSON::SIMD: Perl bindings; fully-featured JSON module that uses simdjson for decoding.
  • gemmaJSON: Nim JSON parser based on simdjson bindings.
  • simdjson-java: Java port.
  • mruby-fast-json: mruby binding with high API coverage.
  • simdjson-dart: Dart bindings for the simdjson project.

About simdjson

The simdjson library takes advantage of modern microarchitectures, parallelizing with SIMD vector instructions, reducing branch misprediction, and reducing data dependency to take advantage of each CPU's multiple execution cores.

Our default front-end is called On-Demand, and we wrote a paper about it:

  • John Keiser, Daniel Lemire, On-Demand JSON: A Better Way to Parse Documents?, Software: Practice and Experience 54 (6), 2024.

Some people enjoy reading the first (2019) simdjson paper: A description of the design and implementation of simdjson is in our research article:

  • Geoff Langdale, Daniel Lemire, Parsing Gigabytes of JSON per Second, VLDB Journal 28 (6), 2019.

We have an in-depth paper focused on the UTF-8 validation:

  • John Keiser, Daniel Lemire, Validating UTF-8 In Less Than One Instruction Per Byte, Software: Practice & Experience 51 (5), 2021.

We also have an informal blog post providing some background and context.

For the video inclined, we had a talk at QCon San Francisco 2019

(It was the best voted talk, we're kinda proud of it.)

We also had a CppCon 2025 talk. We show how C++26 reflection allows for one-line serialization (to_json(player)) or deserialization—without invasive macros or manual mapping—using nothing but the C++ standard library. Whether you’re a performance junkie or simply interested in the roadmap for the next decade of C++ development, watch our full talk!

Citing this work

If you use simdjson in published research, please cite the software library. A suitable BibTeX entry is:

bibtex
@misc{simdjson,
  title={{The simdjson library: Parsing Gigabytes of JSON per Second}},
  author={Daniel Lemire and Geoff Langdale and John Keiser and Paul Dreik and Francisco Thiesen and others},
  year={2019},
  howpublished={Software library},
  note={https://github.com/simdjson/simdjson}
}

Funding

The work is supported by the Natural Sciences and Engineering Research Council of Canada under grants RGPIN-2017-03910 and RGPIN-2024-03787.

Contributi

Issues· 72 open

View all issuesOpen on GitHub
  • #2888

    Using ondemand::parser to parse a very large JSON array which is compressed

    Updated Sep 29, 2026
  • #2314

    Development checks should detect more anti-patterns

    enhancementUpdated Sep 28, 2026
  • #2858

    Exception handling inside tag_invoke customizations

    help wantedUpdated Sep 15, 2026
  • #2861

    [GLD Serializer Benchmark] JavaScript simdjson-parse+JSON.stringify 0.9.2 — spec compliance misses

    Updated Sep 14, 2026
  • #2860

    [GLD Serializer Benchmark] C++ simdjson 3.10.1 — spec compliance misses

    Updated Sep 14, 2026
  • #1369

    rbegin in dom::array

    enhancementUpdated Sep 8, 2026
  • #1091

    Fallback code paths with "SIMD Everywhere"

    help wantedgood first issueperformanceresearchplatform coverageUpdated Sep 6, 2026
  • #1792

    get_float() to retrive 4byte float missing.

    Updated Aug 19, 2026
  • #451

    LTO build is not working in CMake

    help wantedUpdated Aug 8, 2026
  • #2683

    Support for Arm Scalable Vector Extension (SVE/SVE2)

    Updated Jul 28, 2026

> Tags

C++aarch64arm64avx2avx512

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言