The library is part of major linux distributions like Ubuntu, Debian, Arch Linux, Fedora, Alpine 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 the GitHub repository. We have a simdjson organization on GitHub.
Quick Start
Prerequisites: a recent C++ compiler.
- Pull
simdjson.handsimdjson.cppfrom our singleheader directory into a directory of your choice, along with the sample file twitter.json from our jsonexamples repository.
SIMDJSON_BASE="https://raw.githubusercontent.com/simdjson/simdjson/master/"
wget "${SIMDJSON_BASE}singleheader/simdjson.h" \
"${SIMDJSON_BASE}singleheader/simdjson.cpp" \
"${SIMDJSON_BASE}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.
- 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 Selection describes runtime CPU detection and how you can work with it.
Real-world usage
- Node.js
- 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.