Skip to content

Files

Latest commit

07db7bf · Feb 13, 2025

History

History
373 lines (272 loc) · 39 KB

MacOS-GNUCXX.md

File metadata and controls

373 lines (272 loc) · 39 KB

Json-Performance

Performance profiling of JSON libraries (Compiled and run on Darwin 23.6.0 using the AppleClang 15.0.0.15000309 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 605.906 6.04295 2197 3462.5 96.3755 13.8004 2194 22364.6
glaze 280.759 3.88232 2199 7475 318.435 8.63302 2194 6579.1
simdjson 67.096 6.79334 2199 31527.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)
simdjson 379.949 19.3227 4262 10862.5
jsonifier 319.997 26.8541 4256 13423 565.764 21.4381 4250 7300.05
glaze 193.702 9.2176 4261 21116.7 658.834 12.5545 4246 6164.55

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 427.313 15.7009 1064 2400 333.904 7.45117 1042 2983.3
simdjson 126.659 4.4759 1061 7997.9
glaze 124.715 5.44736 1049 8037.5 189.861 11.9678 1055 5312.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 396.282 8.09042 1057 2554.15 287.844 10.3474 1040 3458.1
glaze 175.298 6.95875 1050 5714.6 118.34 9.33807 1040 8412.45
simdjson 120.868 5.689 1060 8375

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 326.765 12.8331 450 1327.05 236.119 8.71969 449 1825.05
glaze 109.613 4.96318 450 3920.7 52.8462 9.53619 451 8172.9
simdjson 61.1653 4.51393 448 7002.1

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 1104.02 5.86393 47030 40693.7 1569.18 2.63193 46465 28248
glaze 897.234 7.63385 48803 51885.3 1297.2 7.82009 49203 36162.6
simdjson 825.427 5.85024 48367 55883.4

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 796.444 8.86204 31875 38200 1448.46 4.24384 34191 22598
glaze 723.476 8.21529 32644 43102.1 1012.85 14.8001 33393 31866.5
simdjson 648.904 4.73694 32495 47829.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 469.291 35.0567 991 2025.15 462.219 58.4545 811 1729.05
simdjson 226.571 56.837 939 4822.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)
jsonifier 270.089 56.2237 674 2645.85 387.987 68.6146 653 1750
simdjson 223.621 57.5528 630 2522.85

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 1089.84 10.6276 47267 41458.4 1448.01 5.49922 48493 31947.9
glaze 955.123 5.7973 48675 48625 1276.83 9.08142 46793 34975.1
simdjson 723.143 6.69461 46643 61606.3

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 805.063 7.76335 33274 39516.7 1575.7 7.17681 31773 19229
glaze 763.95 4.3248 33763 42137.5 1142.4 14.3963 31806 26681.2
simdjson 551.981 7.02192 32451 56174.9

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 1906.66 3.25207 92442 46249.9 2553.84 2.18344 92442 34523
simdjson 1378.03 4.57298 92442 64016.6
glaze 1036.55 2.47331 92442 85075.1 1826.18 6.03325 92442 48341.7

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 1423.19 3.86492 55353 37106.2 2580.82 2.40345 55353 20458.2
simdjson 966.721 2.34464 55353 54614.6
glaze 812.504 3.50884 55353 64989.5 2475.56 4.34262 55353 21337.5

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 1400.06 0.774953 6661897 4.53798e+06 2024.48 1.60248 6661897 3.1385e+06
glaze 1290.72 0.610259 6661897 4.92237e+06 1250.2 6.05323 6661897 5.09167e+06
simdjson 1214.38 0.762899 6661897 5.23188e+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)
glaze 595.274 0.740901 2090234 3.34878e+06 881.76 0.800783 2090234 2.26076e+06
jsonifier 581.852 0.733875 2090234 3.42603e+06 907.328 0.885176 2090234 2.19705e+06
simdjson 422.912 0.425788 2090234 4.71357e+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 1995.28 1.71755 1439562 688090 3280.61 2.22413 1439562 418523
simdjson 1796.71 1.80417 1423415 755592
glaze 1629.7 1.88213 1439584 842481 2649.01 2.8251 1439584 518435

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 1082.91 2.16285 500299 440639 2713.88 0.837089 500299 175810
glaze 818.82 2.91103 500299 583048 2128.31 2.10529 500299 224227
simdjson 743.777 1.82982 492910 632133

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 1820.61 7.82179 44653 23420.8
jsonifier 918.711 9.70263 44653 46702.2 1198.88 7.13685 44653 35627.1

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 1738.49 4.02731 37543 20602.2
jsonifier 1325.86 7.54548 37543 27052 3117.03 3.61251 37543 11491.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 1502.08 2.76334 414021 262952 3253.39 2.06092 414021 121373
simdjson 1497.39 2.85117 418582 266677
glaze 1133.12 2.22244 414021 348485 2597.2 3.14224 414021 152054

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 1320.96 3.17133 277014 200071 3384.75 1.20198 277014 78054.4
simdjson 1182.76 1.3802 278407 224498
glaze 828.246 2.02011 277014 319036 1930.66 3.63766 277014 137108

Library Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
glaze 1416.35 1.60151 466906 314396
jsonifier 1206.23 1.462 466906 369167
simdjson 691.645 1.14497 466906 643817

Library Write (MB/S) Write Percentage Deviation (+/-%) Write Length (Bytes) Write Time (ns)
glaze 1631.69 1.59724 699405 408842
jsonifier 1627.25 1.21003 699405 409910

Library Read (MB/S) Read Percentage Deviation (+/-%) Read Length (Bytes) Read Time (ns)
jsonifier 2580.95 1.41951 631515 233352
glaze 2390.28 0.213018 631515 251962