Skip to content

Latest commit

 

History

History
373 lines (272 loc) · 38.9 KB

MacOS-CLANG.md

File metadata and controls

373 lines (272 loc) · 38.9 KB

Json-Performance

Performance profiling of JSON libraries (Compiled and run on Darwin 23.6.0 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 (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 481.472 5.95188 2193 4354.15 337.908 22.8625 2196 6243.85
glaze 283.321 3.1017 2191 7379.2 210.872 8.59304 2192 9939.7
simdjson 212.054 5.92645 2193 9891.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 454.247 34.4168 4276 9527.05 512.068 17.3875 4337 8204.1
glaze 350.114 23.0892 4298 11839.6 447.218 7.56853 4285 9150.05
simdjson 248.136 31.0692 4282 17102.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 377.257 7.67688 1065 2700.05 312.677 5.49474 1067 3256.15
glaze 210.737 5.9406 1039 4710.45 180.239 10.6273 1041 5525
simdjson 112.442 6.78241 1048 8900.05

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 353.529 5.44643 1055 2847.95 270.513 6.15051 1059 3739.55
glaze 175.9 5.57949 1065 5783.25 117.009 12.1135 1061 8679.1
simdjson 90.5707 5.61933 1046 11031.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 149.174 11.9439 450 2889.65 190.782 6.06627 448 2245.8
glaze 105.673 7.31585 450 4077.05 53.4231 9.22705 449 8072.9
simdjson 74.4085 3.85837 449 5766.75

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)
jsonifier 1035.93 6.47324 45474 41881.2 1523.84 4.70297 48737 30537.4
glaze 991.837 5.89078 45430 43718.7 951.928 9.89844 49081 49222.8
simdjson 458.712 12.0546 47683 99525.1

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)
jsonifier 912.766 4.03893 33015 34539.4 1407.87 2.31946 31280 21187.5
glaze 897.839 4.02289 32950 35010.4 1194.47 10.0107 30625 24470.8
simdjson 605.142 8.24812 32094 50785.4

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 410.433 37.0845 1065 2433.35 503.706 38.8109 938 1770.8
simdjson 306.706 29.8658 865 2618.8

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)
jsonifier 298.654 29.2889 631 2012.55 412.65 39.745 382 856.15
simdjson 269.766 23.1481 582 2000.05

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)
jsonifier 1199.33 4.81781 47708 37960.6 1565.43 3.55362 47716 29085.2
glaze 965.241 12.8078 46380 46037.4 1440.37 5.80119 48117 31835.5
simdjson 570.134 12.4426 47463 79854.1

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)
jsonifier 993.559 3.90308 31182 29945.8 1539.84 4.19416 32483 20093.5
glaze 943.403 5.09256 31848 32219 1141.16 11.1758 30403 25387.5
simdjson 621.903 3.82453 32199 49431.1

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 1818.13 4.219 92442 48531.3 2579.18 1.63658 92442 34183.3
glaze 1419.44 2.5104 92442 62114.6 1867.28 4.05457 92442 47231.2
simdjson 1403.87 2.51439 92442 62804.2

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 1419.88 2.37847 55353 37183.4 2622.62 1.21109 55353 20129.2
glaze 1250.52 2.77238 55353 42231.2 2522.03 3.20896 55353 20935.3
simdjson 865.046 2.42526 55353 61043.7

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 1198.26 0.868381 6661897 5.30239e+06 1084.05 1.63214 6661897 5.86112e+06
glaze 1182.74 1.10978 6661897 5.37186e+06 909.295 12.0938 6661897 7.03001e+06
simdjson 1108.37 1.86842 6661897 5.7334e+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 583.138 0.885804 2090234 3.41848e+06 935.714 0.883004 2090234 2.13042e+06
glaze 487.979 1.14299 2090234 4.08539e+06 848.103 0.968751 2090234 2.35051e+06
simdjson 383.068 0.912472 2090234 5.20387e+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 2274.27 1.97767 1439562 603704 3187.07 1.80161 1439562 430810
glaze 1762.87 1.72594 1439584 778825 2602.32 3.17695 1439584 527827
simdjson 1706.35 2.18222 1423415 795640

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)
jsonifier 1191.76 2.24442 500299 400440 2374.54 1.4634 500299 200948
glaze 1012.5 2.71302 500299 471340 1993.34 2.10296 500299 239440
simdjson 711.273 2.71441 492910 660983

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)
simdjson 1915.76 5.91112 44653 22243.8
jsonifier 1340 5.83898 44653 31818.7 2572.97 4.28694 44653 16564.7

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 1575.6 3.64671 37543 22739.6
jsonifier 1288.47 4.99864 37543 27814.5 2560.38 4.10888 37543 13993.8

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 1817.05 3.22602 414021 217342 2845.69 1.7117 414021 138767
simdjson 1465.64 2.7549 418582 272436
glaze 1400 1.30176 414021 282056 2368.48 1.86532 414021 166721

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 1552.85 3.03855 277014 170208 2987.34 2.05826 277014 88450.1
glaze 1451.42 1.94465 277014 182042 2266.68 2.05894 277014 116575
simdjson 1091.31 2.12779 278407 243331

Library Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
glaze 1423.18 1.77932 466906 312892
jsonifier 1150.58 0.715472 466906 387010
simdjson 665.86 0.935821 466906 668737

Library Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
glaze 1868.22 1.84815 699405 357056
jsonifier 1561.94 0.82378 699405 427048

Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns)
jsonifier 2517.3 0.43455 631515 239252
glaze 2381.81 0.154732 631515 252858