Skip to content

Latest commit

 

History

History
373 lines (272 loc) · 42.1 KB

Ubuntu-CLANG.md

File metadata and controls

373 lines (272 loc) · 42.1 KB

Json-Performance

Performance profiling of JSON libraries (Compiled and run on Linux 6.8.0-1020-azure using the Clang 19.1.7 compiler).

Latest Results: (Feb 01, 2025)

Using the following commits:


| Jsonifier: 27e0345
| Glaze: 48d8ed5
| Simdjson: dbea3bb

1400 iterations on a (AMD EPYC 7763 64-Core Processor), 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 (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 360.437 5.27021 7.06823e+06 2194 5812.85 251.554 6.02327 1.01918e+07 2195 8342.45
glaze 177.939 4.40783 1.39127e+07 2197 11792 300.143 5.9328 8.39554e+06 2194 6986.65
simdjson 133.189 4.99357 1.85443e+07 2195 15746.3

Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 509.958 4.02121 4.85848e+06 4301 8044.35 711.889 4.41001 3.50451e+06 4280 5738.4
glaze 261.054 3.80926 9.47093e+06 4303 15726.6 692.231 4.42203 3.60316e+06 4263 5875.8
simdjson 180.932 11.505 1.36986e+07 4247 22453.3

Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 368.839 4.84589 7.16764e+06 1062 2748.95 240.173 5.98268 1.07122e+07 1028 4086.5
simdjson 123.798 4.97616 2.0236e+07 1057 8148.6
glaze 78.8136 7.86569 3.14767e+07 1034 12546 275.043 6.409 9.29747e+06 1050 3644.75

Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 352.754 6.49378 7.20921e+06 1050 2842.25 259.445 6.39778 9.78732e+06 1054 3879.25
simdjson 125.205 4.71816 2.01487e+07 1051 8016.4
glaze 78.7087 4.69139 3.14228e+07 1054 12784 277.944 6.98781 9.31373e+06 1057 3631.35

Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 264.601 4.27368 1.00163e+07 450 1625 308.014 5.78581 9.11489e+06 448 1389
glaze 103.509 4.89067 2.43941e+07 449 4149.35 138.367 6.98547 1.85497e+07 451 3116.75
simdjson 74.4232 3.10207 3.34888e+07 449 5763.7

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 859.108 2.76884 2.85634e+06 47686 52937.2 1201.25 2.27014 2.04717e+06 45520 36112.8
glaze 588.075 4.97316 4.17163e+06 48285 78428 1249.48 3.10232 1.9632e+06 47686 36403.3
simdjson 561.911 2.48288 4.35879e+06 47173 80051.1

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 773.978 2.04379 3.17421e+06 31527 38816.6 1079.88 2.30628 2.28128e+06 32402 28614.4
glaze 717.288 1.84085 3.42173e+06 32798 43604.7 1122.1 2.74812 2.19985e+06 32847 27939
simdjson 405.108 2.10685 6.04924e+06 33275 78323.7

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 390.803 34.8891 6.42859e+06 835 1930.4 632.252 31.7277 4.26671e+06 1113 1659.4
simdjson 355.527 30.0955 7.14384e+06 1202 3163.35

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 285.418 35.3386 8.84034e+06 586 1823.75 499.022 33.3868 5.43609e+06 629 1150
simdjson 197.723 31.4456 1.29843e+07 581 2682.45

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 (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 916.52 2.1073 2.67726e+06 47989 49915.9 1234.34 1.92935 1.98805e+06 44335 34243.3
glaze 670.908 3.60276 3.6512e+06 46499 66079.5 1279.62 3.04585 1.91614e+06 46495 34630.5
simdjson 496.662 6.66398 4.99294e+06 49024 95289.4

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
glaze 728.138 1.51121 3.37599e+06 31127 40762.9 1098.07 3.22669 2.24333e+06 34021 29584.1
jsonifier 709.196 1.8885 3.46211e+06 32430 43604.2 1058.15 1.92833 2.32576e+06 31457 28341.8
simdjson 432.281 1.37012 5.66873e+06 32481 71627.6

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 1428.98 4.62884 1.7167e+06 94378 63005.9 1825.06 1.6481 1.34537e+06 94378 49319.8
glaze 1144.29 0.969771 2.14191e+06 94378 78660.1 777.99 1.28654 3.14882e+06 94378 115698
simdjson 719.868 0.895096 3.4018e+06 105406 139646

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 1124.15 2.41689 2.1846e+06 56377 47841.8 1495.04 1.2752 1.64386e+06 56377 35964.4
glaze 992.708 1.1548 2.47152e+06 56377 54164.4 888.884 2.85671 2.76065e+06 56377 60506.8
simdjson 436.29 0.977598 5.61319e+06 61629 134718

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 1081.74 0.313386 2.26073e+06 6661897 5.87319e+06 1157.89 3.12573 2.11758e+06 6661897 5.50128e+06
glaze 1053.8 0.189101 2.32067e+06 6661897 6.02895e+06 1063.13 0.537716 2.30035e+06 6661897 5.97609e+06
simdjson 709.73 0.282103 3.44565e+06 6661897 8.95172e+06

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 467.218 0.212745 5.2343e+06 2090234 4.26654e+06 447.527 0.437954 5.46464e+06 2090234 4.45431e+06
glaze 456.258 0.176968 5.36e+06 2090234 4.36903e+06 469.751 1.57783 5.21253e+06 2090234 4.24882e+06
simdjson 273.615 0.171209 8.93776e+06 2090234 7.28545e+06

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 1835.1 0.713271 1.33294e+06 1439562 748135 2576.42 0.972354 949431 1439562 532884
glaze 1532.29 0.535648 1.5963e+06 1439584 895984 1900.68 0.76071 1.28689e+06 1439584 722341
simdjson 978.368 0.535512 2.49991e+06 1423415 1.38751e+06

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 1207.95 1.42335 2.02592e+06 500299 395010 1836.36 1.98251 1.33259e+06 500299 259866
glaze 1016.43 0.908377 2.40748e+06 500299 469432 1501.75 2.02106 1.62937e+06 500299 317781
simdjson 363.561 0.484549 6.72749e+06 492910 1.29299e+06

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 1895.46 2.20473 1.30087e+06 44653 22474.5 2787.37 2.06021 889283 44653 15281.5
simdjson 1425.18 2.5025 1.7265e+06 44653 29888.2

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 1674.78 3.05099 1.47306e+06 37543 21390.6 3218.45 3.35712 776599 37543 11130.3
simdjson 1199.84 2.73005 2.05443e+06 37543 29847

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 1622.33 1.63099 1.50835e+06 719139 422791 2258.23 2.10757 1.08349e+06 719139 303742
glaze 1290.86 0.606528 1.8952e+06 719139 531299 1718.07 1.43516 1.42397e+06 719139 399220
simdjson 955.209 0.645344 2.56098e+06 723784 722644

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


Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
jsonifier 1444.28 1.99011 1.69464e+06 477706 315486 2114.71 2.55516 1.15751e+06 477706 215488
glaze 1129.53 1.57633 2.16634e+06 477706 403387 2082.5 2.11721 1.17506e+06 477706 218787
simdjson 661.131 0.969119 3.70005e+06 479183 691243

Library Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
glaze 1143.94 1.50012 2.13898e+06 466906 389306
jsonifier 1044.88 0.952748 2.34143e+06 466906 426159
simdjson 533.519 0.506518 4.58482e+06 466906 834623

Library Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
glaze 1626.37 1.34627 1.50453e+06 699405 410154
jsonifier 1472.2 1.2151 1.66196e+06 699405 453108

Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns)
jsonifier 2425.02 2.41293 1.00952e+06 631515 248411
glaze 2328.29 2.17537 1.05143e+06 631515 258719