stephenberry / Jsonifier-Performance

A few json-benchmarks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Json-Performance

Performance profiling of JSON libraries (Compiled and run on Ubuntu-22.04 using the Clang++18 compiler)

Latest Results: (Dec 27, 2023)

Single Iteration Test Results (View the data used in the following test):


SingleCoreAPI WebSite

Library Read (MB/s) Write (MB/s)
jsonifier 857.534 1053.52
simdjson 805.063 N/A
glaze 717.433 1004.19

Multi Iteration Test Results (View the data used in the following test):


MinifyCoreAPI WebSite

Library Read (MB/s) Write (MB/s)
jsonifier 1334.96 1207.18
glaze 1072.26 1133.92
simdjson 893.266 N/A

400 iterations on a 6 core (Intel i7 8700k)

ABC Test (Out of Sequence Performance) (View the data used in the following test):


AbcCoreAPI WebSite

The JSON documents in the previous tests featured keys ranging from "a" to "z," where each key corresponds to an array of values. Notably, the documents in this test arrange these keys in reverse order, deviating from the typical "a" to "z" arrangement.

This test effectively demonstrates the challenges encountered when utilizing simdjson and iterative parsers that lack the ability to efficiently allocate memory locations through hashing. In cases where the keys are not in the expected sequence, performance is significantly compromised, with the severity escalating as the document size increases.

In contrast, hash-based solutions offer a viable alternative by circumventing these issues and maintaining optimal performance regardless of the JSON document's scale, or ordering of the keys being parsed.

Library Read (MB/s) Write (MB/s)
jsonifier 1330.35 1206.17
glaze 1070.85 1133.36
simdjson 395.197 N/A

400 iterations on a 6 core (Intel i7 8700k)


DiscordCoreAPI WebSite

Library Read (MB/s) Write (MB/s)
jsonifier 1929.59 2013.29
glaze 1247.18 1994.84
simdjson 243.564 N/A

400 iterations on a 6 core (Intel i7 8700k)


TwitterCoreAPI WebSite

Library Read (MB/s) Write (MB/s)
jsonifier 1759.58 2851.4
simdjson 1248.05 N/A
glaze 1222.44 2656.35

400 iterations on a 6 core (Intel i7 8700k)


MinifyCoreAPI WebSite

Library Read (MB/s) Write (MB/s)
jsonifier N/A 1850.03
simdjson N/A 1079.34

400 iterations on a 6 core (Intel i7 8700k)


PrettifyCoreAPI WebSite

Library Read (MB/s) Write (MB/s)
jsonifier N/A 876.902
glaze N/A 261.813

400 iterations on a 6 core (Intel i7 8700k)


ValidateCoreAPI WebSite

Library Read (MB/s) Write (MB/s)
jsonifier 1277.79 N/A

400 iterations on a 6 core (Intel i7 8700k)

About

A few json-benchmarks.

License:MIT License


Languages

Language:C++ 97.3%Language:Python 1.4%Language:CMake 1.3%