Skip to content

Files

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-1021-azure using the Clang 19.1.7 compiler).

Latest Results: (Feb 13, 2025)

Using the following commits:


| Jsonifier: b4d1bbb
| Glaze: 7e525e8
| Simdjson: 078e2c9

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 208.522 6.17269 1.20065e+07 2195 10066.1 258.419 5.36739 9.74373e+06 2196 8123.1
glaze 170.433 3.37155 1.46223e+07 2195 12288.8 191.749 4.79711 1.30077e+07 2196 10940.9
simdjson 136.409 5.84565 1.82308e+07 2199 15415.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 513.507 4.20391 4.85495e+06 4261 7916 690.652 4.04998 3.66765e+06 4230 5843.9
glaze 263.6 3.40924 9.37623e+06 4224 15281.9 671.666 4.5232 3.75508e+06 4215 5986.3
simdjson 198.432 10.1509 1.24439e+07 4333 20884.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 388.234 7.30417 6.66006e+06 1044 2568.8 258.996 5.61839 9.79752e+06 1031 3798.45
glaze 185.062 7.16166 1.36802e+07 1032 5335.4 235.627 6.16075 1.09314e+07 1025 4158.8
simdjson 125.419 6.60418 1.98734e+07 1039 7906.2

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 320.722 4.8584 8.04145e+06 1049 3122.15 256.179 4.90801 9.88404e+06 1042 3880.85
simdjson 130.383 4.89015 1.91915e+07 1029 7537.1
glaze 79.1332 6.38314 3.12974e+07 1062 12810 273.791 6.44111 9.56207e+06 1029 3590.55

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 252.932 5.4737 1.10313e+07 449 1695.65 293.524 5.26243 9.34085e+06 449 1462.8
glaze 102.417 4.52251 2.48146e+07 449 4191.75 134.423 5.67144 1.92363e+07 451 3209.55
simdjson 73.3682 3.59632 3.41463e+07 451 5866.5

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 839.232 3.29321 2.92342e+06 45359 51526.2 1267.37 2.0603 1.93535e+06 45513 34218
glaze 761.887 2.42525 3.21627e+06 47573 59511.7 1102.8 3.23692 2.22657e+06 48121 41607.8
simdjson 571.017 2.55264 4.29327e+06 46981 78434.9

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 822.841 1.97353 2.97782e+06 31336 36286.2 1105.59 2.36358 2.22332e+06 32591 28115.6
glaze 760.544 1.32741 3.23091e+06 32944 41289.1 1128.92 2.50511 2.18306e+06 32473 27433.3
simdjson 446.088 1.35219 5.49232e+06 32419 69291.3

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 445.273 37.7419 5.58487e+06 937 1899.05 611.96 34.3697 4.32813e+06 858 1306.95
simdjson 318.091 22.2255 7.81327e+06 797 2296.65

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)
simdjson 220.537 21.5987 1.14077e+07 605 2555.7
jsonifier 210.561 28.7728 1.20625e+07 568 2528.8 493.549 33.9306 5.53322e+06 582 1075.65

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 903.528 5.40886 2.72526e+06 45485 47937 1072.74 2.65167 2.29461e+06 45656 40589.8
glaze 807.142 3.23061 3.03381e+06 47210 55720.4 1187.6 4.3437 2.06863e+06 47573 38192.2
simdjson 440.715 9.09547 5.59616e+06 49102 106998

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)
jsonifier 769.497 3.03055 3.1973e+06 31875 39503.3 1077.58 2.91472 2.27963e+06 32612 28847.1
glaze 606.186 2.75024 4.06048e+06 33006 51898.8 968.511 3.11569 2.55289e+06 33789 33290.4
simdjson 413.483 3.06573 5.93e+06 31293 72152.4

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 1616.45 2.10729 1.51617e+06 92442 54546.3 1083.47 1.35223 2.2613e+06 92442 81376.9
glaze 1126.07 1.30795 2.18797e+06 92442 78295.8 1479.06 1.32115 1.6589e+06 92442 59608.7
simdjson 704.48 1.8014 3.47759e+06 92442 125152

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 1225.96 2.16507 2.00409e+06 55353 43068.1 1562.19 1.75184 1.5727e+06 55353 33795.2
glaze 944.255 1.62047 2.59939e+06 55353 55910.2 1553.63 2.26176 1.5843e+06 55353 33984.5
simdjson 440.52 1.04228 5.5586e+06 55353 119840

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)
glaze 1018.56 0.225876 2.40101e+06 6661897 6.23756e+06 734.558 4.75034 3.33132e+06 6661897 8.65447e+06
jsonifier 884.716 2.90299 2.76564e+06 6661897 7.18481e+06 1180.41 3.39412 2.07652e+06 6661897 5.3945e+06
simdjson 708.652 0.289434 3.45097e+06 6661897 8.96535e+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 457.223 0.21062 5.34896e+06 2090234 4.35981e+06 483.956 0.558252 5.0536e+06 2090234 4.11902e+06
glaze 445.224 0.527553 5.49308e+06 2090234 4.47737e+06 459.93 1.49695 5.32297e+06 2090234 4.33876e+06
simdjson 250.879 2.00647 9.75071e+06 2090234 7.94778e+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 1882.53 0.612275 1.29939e+06 1439562 729289 2596.85 1.18228 942121 1439562 528701
glaze 1561.49 0.550032 1.56654e+06 1439584 879236 1890 1.24364 1.29426e+06 1439584 726448
simdjson 965.637 0.385405 2.53293e+06 1423415 1.40579e+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 1203.79 1.57086 2.03303e+06 500299 396394 1943.77 2.00531 1.25927e+06 500299 245490
glaze 1039.52 1.24748 2.354e+06 500299 459024 1585.06 1.83516 1.54432e+06 500299 301065
simdjson 356.566 0.508685 6.85942e+06 492910 1.31836e+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 1944.09 2.78473 1.27038e+06 44653 21910.2 2956.78 2.66734 841443 44653 14407.8
simdjson 1428.51 2.24825 1.72716e+06 44653 29820

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 1797.94 4.38951 1.376e+06 37543 19927.2 3371.56 3.3726 740328 37543 10624.1
simdjson 1216.06 2.4311 2.02637e+06 37543 29452.2

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 1631.29 2.33158 1.50095e+06 414021 242112 2451.67 2.53416 999115 414021 161080
glaze 1203.11 1.98226 2.03459e+06 414021 328248 2009.4 2.56601 1.21944e+06 414021 196547
simdjson 903.547 1.34578 2.70873e+06 418582 441854

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 1483.35 3.58648 1.65156e+06 277014 178166 2381.13 2.64401 1.02967e+06 277014 110969
glaze 1114.76 2.4515 2.19621e+06 277014 237043 2021.44 2.91958 1.21251e+06 277014 130712
simdjson 624.109 1.2706 3.92088e+06 278407 425469

Library Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
glaze 1150.04 0.759103 2.12782e+06 466906 387191
jsonifier 1106.68 1.50222 2.2116e+06 466906 402399
simdjson 530.539 0.588108 4.61097e+06 466906 839301

Library Write (MB/S) Write Percentage Deviation (+/-%) Write (Cycles/MB) Write Length (Bytes) Write Time (ns)
glaze 1581.43 1.45081 1.54819e+06 699405 421820
jsonifier 1533.79 1.18425 1.59542e+06 699405 434907

Library Read (MB/S) Read Percentage Deviation (+/-%) Read (Cycles/MB) Read Length (Bytes) Read Time (ns)
jsonifier 2497.89 1.91542 980255 631515 241134
glaze 2271.42 1.84135 1.07782e+06 631515 265207