The fastest JSON library in C
A high performance JSON library written in ANSI C.
int64, uint64, and double numbers.\u0000 characters, and non-null-terminated strings..h and one .c file.Benchmark project and dataset: yyjson_benchmark
The simdjson's new On Demand API is faster if most JSON fields are known at compile-time.
This benchmark project only checks the DOM API, a new benchmark will be added later.
| twitter.json | parse (GB/s) | stringify (GB/s) |
|---|---|---|
| yyjson(insitu) | 1.80 | 1.51 |
| yyjson | 1.72 | 1.42 |
| simdjson | 1.52 | 0.61 |
| sajson | 1.16 | |
| rapidjson(insitu) | 0.77 | |
| rapidjson(utf8) | 0.26 | 0.39 |
| cjson | 0.32 | 0.17 |
| jansson | 0.05 | 0.11 |
| twitter.json | parse (GB/s) | stringify (GB/s) |
|---|---|---|
| yyjson(insitu) | 3.51 | 2.41 |
| yyjson | 2.39 | 2.01 |
| simdjson | 2.19 | 0.80 |
| sajson | 1.74 | |
| rapidjson(insitu) | 0.75 | |
| rapidjson(utf8) | 0.30 | 0.58 |
| cjson | 0.48 | 0.33 |
| jansson | 0.09 | 0.24 |
More benchmark reports with interactive charts (last updated 2020-12-12)
| Platform | CPU | Compiler | OS | Report |
|---|---|---|---|---|
| Intel NUC 8i5 | Core i5-8259U | msvc 2019 | Windows 10 2004 | Charts |
| Intel NUC 8i5 | Core i5-8259U | clang 10.0 | Ubuntu 20.04 | Charts |
| Intel NUC 8i5 | Core i5-8259U | gcc 9.3 | Ubuntu 20.04 | Charts |
| AWS EC2 c5a.large | AMD EPYC 7R32 | gcc 9.3 | Ubuntu 20.04 | Charts |
| AWS EC2 t4g.medium | Graviton2 (ARM64) | gcc 9.3 | Ubuntu 20.04 | Charts |
| Apple iPhone 12 Pro | A14 (ARM64) | clang 12.0 | iOS 14 | Charts |
…………The latest (unreleased) documentation can be accessed in the doc directory. The pre-generated Doxygen HTML for the release version can be viewed here:
A non-exhaustive list of projects that expose yyjson to other languages or use yyjson internally for a major feature. If you have a project that uses yyjson, feel free to open a PR to add it to this list.
| Project | Language | Description |
|---|---|---|
| ssrJSON | Python | A SIMD boosted high-performance and correct Python JSON parsing library, built on top of yyjson |
| py_yyjson | Python | Python bindings for yyjson |
| orjson | Python | JSON library for Python with an optional yyjson backend |
| serin | C++ / Python | A C++ and Python serialization library supporting TOON, JSON, and YAML with cross-format conversion. |
| cpp-yyjson | C++ | C++ JSON library with a yyjson backend |
| reflect-cpp | C++ | C++ library for serialization through automated field name retrieval from structs |
| xyjson | C++ | C++ proxy and wrapper for yyjson with convenient operator overloading |
| yyjsonr | R | R binding for yyjson |
| Ananda | Swift | JSON model decoding based on yyjson |
| ReerJSON | Swift | A faster version of JSONDecoder based on yyjson |
| swift-yyjson | Swift | A fast JSON library for Swift, powered by yyjson |
| duckdb | C++ | DuckDB is an in-process SQL OLAP Database Management System |
| fastfetch | C | A neofetch-like tool for fetching system information and displaying it in a pretty way |
| Zrythm | C | Digital Audio Workstation that uses yyjson to serialize JSON project files |
| bemorehuman | C | Recommendation engine with a focus on uniqueness of the person receiving the rec |
| mruby-yyjson | mruby | Efficient JSON parsing and serialization library for mruby using yyjson |
| YYJSON.jl | Julia | Julia bindings for yyjson |
| yyjson-go | Go | yyjson for Go, transpiled, CGo-free, 2-4x faster. |
| nim-yyjson | Nim | Thin Nim bindings for yyjson |
RAW type for JSON reader and writer.This project is released under the MIT license.
No open issues yet, or sync has not completed.