Skip to content

Latest commit

 

History

History
373 lines (272 loc) · 38.5 KB

File metadata and controls

373 lines (272 loc) · 38.5 KB

Json-Performance

Performance profiling of JSON libraries (Compiled and run on Darwin 24.6.0 using the GNU 15.2.0 compiler).

Latest Results: (Dec 12, 2025)

Using the following commits:


| Jsonifier: 28dfa9b
| Glaze: d8a8fb9
| Simdjson: ae32422

1400 iterations on a (Apple M1 (Virtual)), where the most stable 20 subsequent iterations are sampled.

Note:

These benchmarks were executed using the CPU benchmark library benchmarksuite.


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 259.376 16.2607 923 3450 98.5967 8.64881 893 8650
simdjson 78.0335 6.45111 886 10850
glaze 43.9985 7.55544 887 19250 210.667 8.66908 883 4000

Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 487.133 30.4028 4287 8550 830.579 6.1228 4248 4900
glaze 304.287 21.8312 4312 13650 422.826 6.01423 4269 9650
simdjson 271.974 34.7031 4242 15600

Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 462.008 0.402518 1937 4000 925.088 0.414938 1940 2000
simdjson 242.691 5.19897 1938 7650
glaze 105.184 2.73438 1939 17600 677.935 9.50014 1938 2800

Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 461.996 0.503161 1937 4000 369.549 0.748387 1937 5000
glaze 239.526 3.99608 1939 7750 677.005 9.56367 1936 2800
simdjson 68.8556 4.43263 1937 26850

Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 431.585 1.66832 452 1000 237.25 10.3608 451 1900
simdjson 78.5732 10.7901 449 5500
glaze 36.9043 5.24667 448 11600 160.925 12.4895 450 2750

Json Test (Prettified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
glaze 1079.17 10.5134 50697 45050 2028.14 3.12637 50078 23550
jsonifier 935.729 10.1922 48803 49850 1974.81 2.75024 48116 23250
simdjson 910.835 8.84116 50838 53500

Json Test (Minified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
glaze 1045.87 4.62094 34377 31350 1828.67 2.6959 34098 17800
simdjson 1042.87 5.63678 34568 31650
jsonifier 957.23 3.42199 34358 34250 1885.61 3.62131 34811 17600

Partial Test (Prettified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
simdjson 965.725 25.4421 898 700
jsonifier 686.913 21.2344 1071 1500 1282.57 13.7466 870 400

Partial Test (Minified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
simdjson 695.705 29.4037 635 650
jsonifier 436.187 15.6054 499 1000 937.462 0 492 50

Abc (Out of Order) Test (Prettified) Results (View the data used in the following test):


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 throughhashing. 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) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
simdjson 1304.37 11.4244 48935 35900
glaze 1145.73 12.4149 48256 40450 2041.69 2.98102 49212 23000
jsonifier 1054.02 5.26581 50802 45900 2012.53 2.01741 50966 24150

Abc (Out of Order) Test (Minified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
simdjson 1043.62 3.06017 34694 31750
glaze 1016.24 5.60997 33703 31700 1908.43 2.11575 35201 17600
jsonifier 884.256 7.10868 34682 37450 1897.83 2.50341 34629 17400

Discord Test (Prettified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 1537.47 1.13668 92442 57350 2298.17 4.09798 92442 38400
simdjson 1239.34 2.55581 92442 71150
glaze 1094.8 5.26426 92442 80700 2039.96 6.05169 92442 43250

Discord Test (Minified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 1107.63 4.68164 55353 47700 1996.73 8.83592 55353 26550
simdjson 796.808 5.35682 55353 66350
glaze 549.713 3.00035 55353 96050 2228.64 12.2721 55353 24000

Canada Test (Prettified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 1166.83 5.78103 6661897 5.4478e+06 989.892 24.2338 6661897 6.49785e+06
glaze 1157.69 8.30599 6661897 5.49325e+06 367.196 30.3457 6661897 1.7874e+07
simdjson 833.834 12.28 6661897 7.66315e+06

Canada Test (Minified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 553.293 2.62709 2090234 3.6037e+06 725.606 2.58065 2090234 2.74805e+06
glaze 487.039 3.17244 2090234 4.0942e+06 747.86 2.7908 2090234 2.6663e+06
simdjson 324.477 1.76788 2090234 6.14385e+06

CitmCatalog Test (Prettified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 1817.7 2.2925 1439562 755450 2539.53 3.97857 1439562 541150
glaze 1589.75 1.97626 1439584 863750 2344.64 2.73323 1439584 585750
simdjson 1573 2.15581 1423415 863200

CitmCatalog Test (Minified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
glaze 956.425 4.06538 500299 499150 2117.88 4.94386 500299 225650
jsonifier 891.094 3.35126 500299 535750 1878.41 5.22265 500299 254450
simdjson 606.936 2.82229 492910 774700

Twitter Partial Test (Prettified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 1680.72 2.54994 44653 25350 3088.54 1.51515 44653 13800
simdjson 1497.57 8.27211 44653 28500

Twitter Partial Test (Minified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
simdjson 1506.65 4.94454 37543 23800
jsonifier 575.169 7.09076 37543 62300 2811.52 2.04082 37543 12750

Twitter Test (Prettified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 1548.97 3.44477 414021 254950 3034.39 2.16397 414021 130150
simdjson 1464.49 4.02113 418582 272800
glaze 1350.85 2.57001 414021 292400 2310.65 3.45809 414021 170950

Twitter Test (Minified) Results (View the data used in the following test):


Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 1453.06 3.29214 277014 181900 3222.75 4.68175 277014 82050
glaze 1344.8 3.22829 277014 196500 2774.79 3.83075 277014 95250
simdjson 1063.66 3.62189 278407 249800

Library Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
glaze 1401.62 2.2505 466906 317750
jsonifier 994.688 1.61448 466906 447700
simdjson 750.42 1.10509 466906 593450

Library Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
glaze 1707.6 3.0747 699405 390750
jsonifier 1512.63 1.35221 699405 441000

Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns)
glaze 2289.15 1.46334 631515 263100
jsonifier 2274.55 1.56797 631515 264800