Software
The library is part of major linux distributions like Ubuntu and Debian and as a FreeBSD package. It is in Microsoft vcpkg. It is available as an MSYS2 package, from brew and from conan. We publish it as single-header library as well as a CMake build from theGitHub repository. We have a simdjson organization on GitHub.
Quick Start
Prerequisites: g++
(version 7 or better) or clang++
(version 6 or better), and a 64-bit system (e.g., linux, Windows, FreeBSD, macOS).
- Pull
simdjson.h
andsimdjson.cpp
from our singleheader directory into a directory of your choice, along with the sample file twitter.json from our jsonexamples repository..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
- Create
quickstart.cpp
:
#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;
}
-
Compile:
c++ -o quickstart quickstart.cpp simdjson.cpp -std=c++17
-
Run:
./quickstart
Documentation
Usage documentation is available:
- Basics is an overview of how to use simdjson and its APIs.
- 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.
Real-world usage
- ClickHouse
- Meta Velox
- Google Pax
- milvus
- Clang Build Analyzer
- Shopify HeapProfiler
- StarRocks
- Microsoft FishStore
- Intel PCM
- WatermelonDB
- Apache Doris
- Dgraph
- UJRPC
- fastgltf
- vast
- ada-url
- fastgron
If you are planning to use simdjson in a product, please work from one of our releases.
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.
- fast_jsonparser: Ruby bindings for the simdjson project.
- simdjson_ruby: Ruby bindings for the simdjson project.
- simdjson-go: Go port using Golang assembly.
- rcppsimdjson: R bindings.
- simdjson_erlang: erlang bindings.
- lua-simdjson: lua bindings.
- hermes-json: haskell bindings.