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 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.

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 592.421 2.34666 2191 3529.15 404.305 6.66104 2191 5172.85
glaze 244.046 4.34668 2195 8591.65 208.929 8.68344 2196 10064.7
simdjson 203.015 3.84662 2196 10327.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 378.164 36.448 4289 11347.9 629.618 7.25866 4227 6414.6
simdjson 326.803 28.1609 4245 12720.9
glaze 292.863 16.4301 4245 14052 472.954 7.80804 4254 8585.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 448.37 3.95503 1068 2273 321.175 4.31646 1053 3129.2
glaze 179.643 7.62275 1062 5652.1 100.803 11.9375 1051 9970.85
simdjson 105.968 5.81314 1071 9652.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 313.985 6.2566 1053 3206.25 297.191 4.52027 1056 3389.6
glaze 152.896 7.84633 1046 6539.5 114.752 11.9574 1058 8820.85
simdjson 96.5069 8.04124 1050 10395.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 344.62 4.04328 448 1241.8 245.213 2.43735 448 1743.8
glaze 89.0695 6.73276 448 4810.4 55.9132 8.61938 450 7695.8
simdjson 71.6788 6.68693 450 6008.45

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 1190.27 2.30526 47716 38235.3 1620.93 2.68992 46087 27106.3
glaze 1058.64 3.11103 47851 43145.9 1557.99 5.06856 46663 28520.8
simdjson 658.242 8.65234 46271 67200.2

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 1019.55 2.95567 32956 30814.5 1420.58 2.158 30864 20741.6
glaze 929.438 3.11614 32024 32866.7 1325.9 9.10682 31766 22954.2
simdjson 632.311 3.47666 31503 47543.8

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 841.531 11.8322 956 1062.6
jsonifier 792.423 12.8009 936 1100.1 1847.84 12.6953 877 445.85

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 568.655 13.8101 724 1212.4
jsonifier 541.175 11.5634 716 1254 1852.49 21.5417 803 410.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 Length (Bytes) Read Time (ns) Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
jsonifier 1159.94 3.48629 45400 37352.2 1651.01 4.66276 45635 26350.1
glaze 1089.48 4.65715 46493 40733.3 1499.53 3.77389 45985 29214.6
simdjson 583.159 8.67623 45018 73674.9

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 1049.89 3.57681 31420 28550 1631.99 1.70277 33226 19410.5
glaze 878.391 7.2854 32363 35189.6 1156.17 15.2185 32085 26739.5
simdjson 640.166 3.22463 32816 48993.8

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 2029.98 1.01685 92442 43431.3 2586.43 1.43889 92442 34087.6
simdjson 1468.38 1.37399 92442 60041.7
glaze 1258.21 5.633 92442 70185.4 2112.04 6.19883 92442 41787.5

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 1509.59 1.95701 55353 34972.8 2461.98 3.9958 55353 21458.6
glaze 1306.98 2.38123 55353 40395.9 2742.64 1.50728 55353 19250
simdjson 911.795 1.59364 55353 57902.1

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 1386.33 0.869283 6661897 4.58289e+06 1869.73 1.66964 6661897 3.39851e+06
glaze 1216.95 1.53841 6661897 5.22092e+06 699.276 38.8164 6661897 9.41404e+06
simdjson 1009.1 2.8802 6661897 6.29871e+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 580.933 0.735095 2090234 3.43152e+06 717.442 1.37312 2090234 2.77867e+06
glaze 491.583 1.07479 2090234 4.05528e+06 881.205 0.623815 2090234 2.26215e+06
simdjson 399.326 0.724969 2090234 4.99204e+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 2222.38 2.56304 1439562 617885 3299.47 2.15432 1439562 416190
glaze 1693.73 1.79294 1439584 810700 1102.22 4.703 1439584 1.24698e+06
simdjson 1611.61 2.1473 1423415 842404

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 1209.67 1.90473 500299 394492 2504.96 2.75883 500299 190552
glaze 1141.05 2.61614 500299 418400 2276.53 2.8773 500299 209608
simdjson 694.771 1.58086 492910 676652

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 1939.05 4.34494 44653 21970.8
jsonifier 1825.45 1.25623 44653 23329.1 3575.16 1.76329 44653 11912.4

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 1664.37 4.56977 37543 21529.3
jsonifier 1591.04 3.55981 37543 22506.3 3463.85 1.17208 37543 10337.5

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 1924.35 2.27497 414021 205231 3362.11 0.510383 414021 117440
glaze 1610.4 3.18603 414021 245265 2929.61 2.92295 414021 134792
simdjson 1577.69 3.36542 418582 253173

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 1571.86 3.33901 277014 168100 3508.2 1.7779 277014 75312.6
glaze 1407.21 2.91715 277014 187792 2923.43 1.64147 277014 90377.1
simdjson 1182.46 2.88363 278407 224637

Library Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
glaze 1447.94 1.18403 466906 307531
jsonifier 1224.12 1.12092 466906 363765
simdjson 714.126 0.573873 466906 623531

Library Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
glaze 1921.14 1.28405 699405 347204
jsonifier 1653.76 1.21612 699405 403348

Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns)
jsonifier 2432.96 1.0822 631515 247571
glaze 2395.29 1.28507 631515 251442