1
0
Fork 0
mirror of https://github.com/ultrajson/ultrajson.git synced 2024-06-03 11:36:06 +02:00

Update benchmark in README

This commit is contained in:
Hugo 2020-03-23 19:26:14 +02:00
parent 0c5af10ff9
commit f8c881a0e4

View File

@ -96,142 +96,76 @@ Controls whether indention ("pretty output") is enabled. Default is ``0`` (disab
==========
Benchmarks
==========
*UltraJSON* calls/sec compared to three other popular JSON parsers with performance gain specified below each.
*UltraJSON* calls/sec compared to other popular JSON parsers with performance gain specified below each.
~~~~~~~~~~~~~
Test machine:
~~~~~~~~~~~~~
Linux 3.13.0-66-generic x86_64 #108-Ubuntu SMP Wed Oct 7 15:20:27 UTC 2015
Linux 5.0.0-1032-azure x86_64 #34-Ubuntu SMP Mon Feb 10 19:37:25 UTC 2020
~~~~~~~~~
Versions:
~~~~~~~~~
- CPython 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2]
- blist : 1.3.6
- simplejson: 3.8.1
- ujson : 1.34 (0c52200eb4e2d97e548a765d5f089858c41967b0)
- yajl : 0.3.5
- CPython 3.8.2 (default, Feb 28 2020, 14:28:43) [GCC 7.4.0]
- nujson : 1.35.2
- orjson : 2.6.1
- simplejson: 3.17.0
- ujson : 2.0.2
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| | ujson | yajl | simplejson | json |
+===============================================================================+============+============+============+============+
| Array with 256 doubles | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 3508.19 | 5742.00 | 3232.38 | 3309.09 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 25103.37 | 11257.83 | 11696.26 | 11871.04 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Array with 256 UTF-8 strings | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 3189.71 | 2717.14 | 2006.38 | 2961.72 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 1354.94 | 630.54 | 356.35 | 344.05 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Array with 256 strings | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 18127.47 | 12537.39 | 12541.23 | 20001.00 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 23264.70 | 12788.85 | 25427.88 | 9352.36 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Medium complex object | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 10519.38 | 5021.29 | 3686.86 | 4643.47 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 9676.53 | 5326.79 | 8515.77 | 3017.30 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Array with 256 True values | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 105998.03 | 102067.28 | 44758.51 | 60424.80 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 163869.96 | 78341.57 | 110859.36 | 115013.90 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Array with 256 dict{string, int} pairs | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 13471.32 | 12109.09 | 3876.40 | 8833.92 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 16890.63 | 8946.07 | 12218.55 | 3350.72 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Dict with 256 arrays with 256 dict{string, int} pairs | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 50.25 | 46.45 | 13.82 | 29.28 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 33.27 | 22.10 | 27.91 | 10.43 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Dict with 256 arrays with 256 dict{string, int} pairs, outputting sorted keys | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 27.19 | | 7.75 | 2.39 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Complex object | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 577.98 | | 387.81 | 470.02 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 496.73 | 234.44 | 151.00 | 145.16 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
~~~~~~~~~
Versions:
~~~~~~~~~
- CPython 3.4.3 (default, Oct 14 2015, 20:28:29) [GCC 4.8.4]
- blist : 1.3.6
- simplejson: 3.8.1
- ujson : 1.34 (0c52200eb4e2d97e548a765d5f089858c41967b0)
- yajl : 0.3.5
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| | ujson | yajl | simplejson | json |
+===============================================================================+============+============+============+============+
| Array with 256 doubles | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 3477.15 | 5732.24 | 3016.76 | 3071.99 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 23625.20 | 9731.45 | 9501.57 | 9901.92 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Array with 256 UTF-8 strings | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 1995.89 | 2151.61 | 1771.98 | 1817.20 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 1425.04 | 625.38 | 327.14 | 305.95 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Array with 256 strings | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 25461.75 | 12188.64 | 13054.76 | 14429.81 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 21981.31 | 17014.22 | 23869.48 | 22483.58 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Medium complex object | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 10821.46 | 4837.04 | 3114.04 | 4254.46 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 7887.77 | 5126.67 | 4934.60 | 6204.97 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Array with 256 True values | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 100452.86 | 94639.42 | 46657.63 | 60358.63 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 148312.69 | 75485.90 | 88434.91 | 116395.51 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Array with 256 dict{string, int} pairs | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 11698.13 | 8886.96 | 3043.69 | 6302.35 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 10686.40 | 7061.77 | 5646.80 | 7702.29 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Dict with 256 arrays with 256 dict{string, int} pairs | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 44.26 | 34.43 | 10.40 | 21.97 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 28.46 | 23.95 | 18.70 | 22.83 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Dict with 256 arrays with 256 dict{string, int} pairs, outputting sorted keys | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 33.60 | | 6.94 | 22.34 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| Complex object | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| encode | 432.30 | | 351.47 | 379.34 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
| decode | 434.40 | 221.97 | 149.57 | 147.79 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| | ujson | nujson | orjson | simplejson | json |
+===============================================================================+============+============+============+============+============+
| Array with 256 doubles | | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| encode | 22,082 | 4,282 | 76,975 | 5,328 | 5,436 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| decode | 24,127 | 34,349 | 29,059 | 14,174 | 13,822 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| Array with 256 UTF-8 strings | | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| encode | 3,557 | 2,528 | 24,300 | 3,061 | 2,068 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| decode | 2,030 | 2,490 | 931 | 406 | 358 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| Array with 256 strings | | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| encode | 39,041 | 31,769 | 76,403 | 16,615 | 16,910 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| decode | 25,185 | 24,287 | 34,437 | 32,388 | 27,999 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| Medium complex object | | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| encode | 10,382 | 11,427 | 32,995 | 3,959 | 5,275 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| decode | 9,785 | 9,796 | 11,515 | 5,898 | 7,200 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| Array with 256 True values | | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| encode | 114,341 | 101,039 | 344,256 | 62,382 | 72,872 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| decode | 149,367 | 151,615 | 181,123 | 114,597 | 130,392 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| Array with 256 dict{string, int} pairs | | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| encode | 13,715 | 14,420 | 51,942 | 3,271 | 6,584 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| decode | 12,670 | 11,788 | 12,176 | 6,743 | 8,278 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| Dict with 256 arrays with 256 dict{string, int} pairs | | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| encode | 50 | 54 | 216 | 10 | 23 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| decode | 32 | 32 | 30 | 20 | 23 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| Dict with 256 arrays with 256 dict{string, int} pairs, outputting sorted keys | | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| encode | 46 | 41 | | 8 | 24 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| Complex object | | | | | |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| encode | 533 | 582 | | 408 | 431 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| decode | 466 | 454 | | 154 | 164 |
+-------------------------------------------------------------------------------+------------+------------+------------+------------+------------+