Make sure Doxygen 1.8.13 or higher version has been installed. Then following:
mdkir api-doc && cd api-doc
doxygen ../Doxyfile
Design
Sonic-cpp parses JSON into a compact document tree. The document structure is as follows:
There are many optimizations in parsing as follows:
using SIMD to accelerate skipping white space.
using SIMD to find escaped chars when parsing strings.
using the STOA float pointing algorithm.
Sonic-cpp serializes a document to JSON. When serializing JSON strings, we should check the escaped characters first. So, we use SIMD instructions(AVX2/SSE) to find the escaped char for a long JSON string.
Sonic-cpp also supports ParseOnDemand if the user knows the target key at compile time. ParseOndemand also used SIMD and bit manipulation to skip the unwanted values fastly.
Usage
Include
Sonic-Cpp is a header-only library, you only need to include the directory of
Sonic-Cpp header files, such as adding -I/path/to/sonic/include/ to your
compiler.
Sonic-Cpp
A fast JSON serializing & deserializing library, accelerated by SIMD.
Requirement
Features
Benchmarks
use CMake
use bazel
Performance by sonic benchmark
Parsing Performance
Serializing performance
Performance by third-party benchmark
Below data is test by https://github.com/miloyip/nativejson-benchmark:
Parsing Performance
Serializing Performance
API Document
Make sure Doxygen 1.8.13 or higher version has been installed. Then following:
Design
Sonic-cpp parses JSON into a compact document tree. The document structure is as follows:
There are many optimizations in parsing as follows:
Sonic-cpp serializes a document to JSON. When serializing JSON strings, we should check the escaped characters first. So, we use SIMD instructions(AVX2/SSE) to find the escaped char for a long JSON string.
Sonic-cpp also supports ParseOnDemand if the user knows the target key at compile time. ParseOndemand also used SIMD and bit manipulation to skip the unwanted values fastly.
Usage
Include
Sonic-Cpp is a header-only library, you only need to include the directory of Sonic-Cpp header files, such as adding
-I/path/to/sonic/include/to your compiler.Parsing and Serializing
Checking parse result
Getting and Setting
The following Is*, Get* and Set* methods are supported:
More usage.
RoadMap
RawNumberfor JSON parsing.JSON Path.JSON Merge Patch.JSON Pointer.Contributing
Please read CONTRIBUTING.md for information on contributing to sonic-cpp.