Performance profiling of JSON libraries (Compiled and run on Darwin 23.6.0 using the AppleClang 15.0.0.15000309 compiler).
Latest Results: (Jan 20, 2025)
Using the following commits:
| Jsonifier: 431c91e
| Glaze: 37c19d1
| Simdjson: 5642bb9
1200 iterations on a (Apple M1 (Virtual)), where the most stable 20 subsequent iterations are sampled.
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
1149.22
3.0198
72944
60562.4
1891.52
4.78375
72944
36804.8
glaze
1023.98
3.007
72944
67962.6
1756.37
3.59477
72944
39618.8
simdjson
957.068
4.67496
72944
72749.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)
glaze
766.509
3.12222
41333
51447.8
1607.33
1.74254
41333
24527.3
jsonifier
683.492
2.93713
41333
57689.6
1955.36
3.04428
41333
20164.7
simdjson
565.932
3.65207
41333
69689.6
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
770.428
4.81511
3621
4487.5
736.428
3.81133
3621
4693
simdjson
733.969
3.48906
3621
4708.4
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
517.593
3.33493
2055
3787.91
866.588
4.77836
2055
2266.6
simdjson
420.622
4.42468
2055
4662.45
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
1202.19
3.69281
72944
57906.2
2158.83
4.16847
72944
32241.6
glaze
1023.59
2.4466
72944
67972.9
1823.05
4.9979
72944
38180.6
simdjson
985.267
2.83619
72944
70633.4
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
751.818
3.2807
41333
52462.6
1550.56
2.69098
41333
25427.2
jsonifier
709.351
3.7058
41333
55595.8
2006.22
2.57351
41333
19652
simdjson
587.398
3.26997
41333
67137.4
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
1801.35
3.44755
94378
49995.9
2634.8
4.88808
94378
34172.9
simdjson
1470.16
1.38237
105406
68379.2
glaze
1094.15
4.67051
94378
82277.1
2130.33
3.97777
94378
42285.4
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
1279.45
1.89558
56377
42027.1
2787.78
1.93184
56377
19289.7
simdjson
933.631
2.39988
61629
62960.4
glaze
815.809
1.3896
56377
65910.5
2562.03
3.14584
56377
20989.7
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
1443.11
0.59358
6661897
4.40255e+06
1810.92
1.21031
6661897
3.50848e+06
glaze
1312.61
0.378426
6661897
4.84024e+06
1258.31
4.23332
6661897
5.05331e+06
simdjson
1195.6
0.834761
6661897
5.31402e+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
614.773
0.48203
2090234
3.24254e+06
898.103
0.670019
2090234
2.21965e+06
glaze
592.144
0.640837
2090234
3.36645e+06
861.625
0.567771
2090234
2.31356e+06
simdjson
422.125
0.418011
2090234
4.72234e+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
2131.2
1.61476
1439562
644221
3119.09
1.1822
1439562
440158
simdjson
1763.97
1.82663
1423415
769669
glaze
1638.42
1.79483
1439584
838010
2833.66
1.08963
1439584
484508
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
1223.07
1.69592
500299
390135
2527.34
0.965559
500299
188790
glaze
915.369
2.5197
500299
521384
2176.74
1.52418
500299
219200
simdjson
733.018
1.46653
492910
641327
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
1760.87
4.69475
44653
24197.9
jsonifier
1644.35
4.96351
44653
25921.7
3474.6
3.87501
44653
12264.6
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
1676.69
3.84593
37543
21360.2
jsonifier
1652.78
4.95471
37543
21670.8
5274.14
3.58538
37543
6791.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
2078.23
2.50976
719139
330071
3500.75
1.16054
719139
195913
simdjson
1730.2
1.78809
723784
398973
glaze
1154.05
1.15306
719139
594310
2791.4
0.980517
719139
245698
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
1593.09
2.42755
477706
286021
3830.47
0.85309
477706
118937
simdjson
1222.53
1.08889
479183
373817
glaze
891.246
1.50915
477706
511208
3182.42
0.959581
477706
143160
Library
Write (MB/S)
Write Percentage Deviation (+/-%)
Write Length (Bytes)
Write Time (ns)
glaze
1446.88
1.7302
466906
307769
jsonifier
1256.52
1.20924
466906
354375
simdjson
686.731
0.805735
466906
648412
Library
Write (MB/S)
Write Percentage Deviation (+/-%)
Write Length (Bytes)
Write Time (ns)
glaze
1821.91
1.58531
699405
366148
jsonifier
1706.56
0.32597
699405
390848
Library
Read (MB/S)
Read Percentage Deviation (+/-%)
Read Length (Bytes)
Read Time (ns)
jsonifier
2459.36
0.114944
631515
244885
glaze
2396.92
0.143348
631515
251264