Performance profiling of JSON libraries (Compiled and run on Darwin 23.6.0 using the AppleClang 15.0.0.15000309 compiler).
Latest Results: (Feb 09, 2025)
Using the following commits:
| Jsonifier: 80665a2
| Glaze: 2f9db34
| Simdjson: dbea3bb
1400 iterations on a (Apple M1 (Virtual)), where the most stable 20 subsequent iterations are sampled.
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
686.014
2.01636
2196
3054.2
396.573
6.58407
2199
5295.95
glaze
284.467
2.90608
2197
7370.9
272.117
5.89338
2195
7702.15
simdjson
220.468
3.56459
2191
9493.8
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
521.931
28.2102
4293
7939.5
641.593
5.15118
4275
6362.4
simdjson
434.329
12.4501
4289
9454.2
glaze
350.863
11.5113
4273
11673.1
444.409
8.6661
4265
9179.2
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
482.396
4.42667
1056
2089.45
331.367
6.30455
1051
3028.95
glaze
220.799
5.45006
1060
4583.4
205.711
10.8096
1047
4860.25
simdjson
122.379
5.80476
1046
8156.15
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
435.289
4.25374
1053
2308.45
309.839
5.00569
1051
3239.5
glaze
176.376
5.55729
1062
5745.95
134.274
7.77052
1057
7518.75
simdjson
121.84
4.61009
1052
8243.75
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
394.805
4.66606
450
1089.55
254.405
2.60963
448
1681.3
glaze
94.2868
8.03027
448
4554.25
54.1312
11.0909
449
7937.65
simdjson
60.8144
2.78234
448
7037.5
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
1173.97
2.71609
46199
37520.9
1344.03
7.77938
46347
32945.8
glaze
966.649
3.91762
46451
45850.1
911.336
13.2934
48146
50883.2
simdjson
862.15
5.35457
45719
50710.3
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
915.994
2.81357
32951
34324.9
1408.97
1.45455
32644
22102
glaze
803.495
1.8446
32547
38639.4
1350.25
11.1981
32632
23170.8
simdjson
666.782
2.72353
31926
45674.9
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
852.141
21.9287
1020
1112.45
jsonifier
814.042
10.2061
984
1131.35
1798.69
14.9133
885
458.2
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
608.757
16.5109
718
1106.2
jsonifier
557.176
10.3157
611
1020.75
1684.6
16.8946
605
337.4
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)
jsonifier
1206.48
4.22217
47745
37772.9
1662.53
1.66331
48401
27770.8
glaze
1017.14
2.57552
48176
45172.8
1520.18
3.20022
46742
29295.7
simdjson
739.474
10.1747
46237
59795.8
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
949.25
1.88551
32235
32406.2
1520.84
2.26368
32532
20412.6
glaze
794.403
5.88409
32149
38585.4
1209.56
12.1093
32504
25756.2
simdjson
597.308
8.56152
32256
51685.3
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
2043.1
1.55852
92442
43154.2
2692.71
0.910583
92442
32741.6
simdjson
1469.91
1.13906
92442
59979.3
glaze
1136.73
1.04533
92442
77558.4
2394
2.987
92442
36831.2
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
1487.28
1.1792
55353
35495.9
2810.61
1.36556
55353
18783.3
simdjson
962.296
1.08358
55353
54860.3
glaze
836.153
1.48266
55353
63137.3
2843.32
1.85622
55353
18568.8
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
1322.31
0.657255
6661897
4.8048e+06
1206.39
1.19621
6661897
5.26659e+06
glaze
1218.84
0.869327
6661897
5.21268e+06
642.119
36.65
6661897
1.01719e+07
simdjson
1148.33
1.40864
6661897
5.53309e+06
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
594.566
0.666751
2090234
3.35275e+06
896.422
0.698496
2090234
2.22379e+06
glaze
576.381
0.648128
2090234
3.45859e+06
882.475
0.750588
2090234
2.25892e+06
simdjson
388.415
0.563806
2090234
5.13224e+06
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
2392.95
0.969667
1439562
573740
3479.38
1.19178
1439562
394585
simdjson
1827.62
0.811585
1423415
742769
glaze
1699.94
0.728589
1439584
807637
2750.01
1.21548
1439584
499273
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
1105.98
1.36529
500299
431433
2758.27
1.08422
500299
172986
glaze
938.911
1.3192
500299
508215
2239.4
2.1547
500299
213085
simdjson
751.89
1.19453
492910
625215
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
1976.21
3.15278
44653
21558.2
jsonifier
1640.3
2.18755
44653
25975
3407.01
1.31804
44653
12500
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
1726
1.80444
37543
20747.9
jsonifier
1632.51
1.98079
37543
21935.4
3494.22
1.23777
37543
10248
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
1973.72
1.59473
414021
200060
3307.27
1.09627
414021
119392
simdjson
1693.68
1.43439
418582
235714
glaze
1132.77
0.976851
414021
348583
2947.15
0.698313
414021
133977
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
1486.61
1.68374
277014
177725
3457.48
0.60665
277014
76410.4
simdjson
1225.35
1.60224
278407
216723
glaze
912.661
1.4314
277014
289485
3025.25
0.672948
277014
87326.9
Library
Write (MB/S)
Write Percentage Deviation (+/-%)
Write Length (Bytes)
Write Time (ns)
glaze
1451.93
0.630403
466906
306683
jsonifier
1234.63
0.998559
466906
360669
simdjson
707.508
0.666925
466906
629365
Library
Write (MB/S)
Write Percentage Deviation (+/-%)
Write Length (Bytes)
Write Time (ns)
glaze
1870.67
1.15039
699405
356571
jsonifier
1596.6
0.758843
699405
417775
Library
Read (MB/S)
Read Percentage Deviation (+/-%)
Read Length (Bytes)
Read Time (ns)
jsonifier
2649.69
1.72828
631515
227302
glaze
2368.99
0.918292
631515
254267