Software

The library is part of major linux distributions like Ubuntu and Debian and as a FreeBSD package. It is in Microsoft vpkg. 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 and simdjson.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"
       int main(void) {
         simdjson::dom::parser parser;
         simdjson::dom::element tweets
           = parser.load("twitter.json");
         std::cout << 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

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).