Skip to content

Conversation

@TkTech
Copy link
Owner

@TkTech TkTech commented Feb 19, 2025

@TkTech TkTech self-assigned this Feb 19, 2025
@TkTech
Copy link
Owner Author

TkTech commented Feb 20, 2025

pypa/setuptools#4810 makes it impossible to specify a define:

[tool.setuptools]
ext-modules = [
    { name = "csimdjson", sources = ["simdjson/simdjson.cpp", "simdjson/util.cpp", "simdjson/csimdjson.pyx"], py-limited-api = true, define-macros = [["SIMDJSON_IMPLEMENTATION_FALLBACK", "1"]] },
]

TOML has no concept of a tuple, and an overly zealous type check in distutils requires define-macros to be a list of tuples.

@TkTech TkTech mentioned this pull request Feb 20, 2025
4 tasks
@TkTech
Copy link
Owner Author

TkTech commented Feb 23, 2025

Before:

--------------------------------------------------------------- benchmark 'Complete load of data/canada.json': 7 tests ---------------------------------------------------------------
Name (time in ms)         Min                Max               Mean            StdDev             Median                IQR            Outliers      OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
orjson                 5.6570 (1.0)      16.1976 (1.0)      10.6838 (1.0)      4.0984 (1.34)     13.3461 (1.03)      8.2708 (1.39)         62;0  93.5993 (1.0)         128           1
msgspec                6.1988 (1.10)     16.4822 (1.02)     11.1220 (1.04)     3.7485 (1.23)     13.0013 (1.0)       7.4626 (1.25)         22;0  89.9120 (0.96)         47           1
simdjson               6.5313 (1.15)     19.1239 (1.18)     12.6379 (1.18)     4.9501 (1.62)     15.8949 (1.22)     10.0100 (1.68)         20;0  79.1270 (0.85)         44           1
yyjson                 6.6903 (1.18)     22.6296 (1.40)     13.9934 (1.31)     5.8496 (1.91)     17.8452 (1.37)     11.7931 (1.98)         46;0  71.4621 (0.76)         97           1
ujson                 10.5326 (1.86)     22.2260 (1.37)     16.8325 (1.58)     5.2697 (1.72)     20.3775 (1.57)     10.6207 (1.78)         19;0  59.4090 (0.63)         40           1
json                  23.1832 (4.10)     32.1774 (1.99)     27.3141 (2.56)     3.0582 (1.0)      28.7539 (2.21)      5.9684 (1.0)          12;0  36.6112 (0.39)         30           1
rapidjson             24.0801 (4.26)     36.0040 (2.22)     30.2639 (2.83)     4.8474 (1.59)     33.4395 (2.57)      9.8161 (1.64)         17;0  33.0427 (0.35)         38           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------- benchmark 'Complete load of data/citm_catalog.json': 7 tests ----------------------------------------------------------
Name (time in ms)        Min                Max              Mean            StdDev            Median               IQR            Outliers       OPS            Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
orjson                2.3506 (1.0)      15.0233 (1.19)     4.3201 (1.0)      3.4020 (1.67)     2.5434 (1.0)      0.2170 (1.0)         65;65  231.4753 (1.0)         289           1
msgspec               2.9541 (1.26)     14.3030 (1.13)     4.6709 (1.08)     2.8855 (1.42)     3.1477 (1.24)     0.2920 (1.35)        73;74  214.0894 (0.92)        321           1
yyjson                2.9801 (1.27)     15.2074 (1.20)     5.5178 (1.28)     4.6234 (2.27)     3.1542 (1.24)     0.2648 (1.22)        13;13  181.2301 (0.78)         61           1
simdjson              3.1813 (1.35)     14.8978 (1.18)     5.6361 (1.30)     4.1586 (2.04)     3.4300 (1.35)     0.3272 (1.51)        39;39  177.4263 (0.77)        172           1
ujson                 4.8298 (2.05)     18.6481 (1.48)     7.8788 (1.82)     4.6779 (2.30)     5.3995 (2.12)     0.7307 (3.37)        40;41  126.9225 (0.55)        178           1
rapidjson             5.0617 (2.15)     14.7168 (1.16)     7.1031 (1.64)     3.5690 (1.75)     5.2205 (2.05)     0.2695 (1.24)        15;15  140.7843 (0.61)         66           1
json                  6.1527 (2.62)     12.6425 (1.0)      7.4784 (1.73)     2.0373 (1.0)      6.4093 (2.52)     0.2777 (1.28)        36;36  133.7191 (0.58)        157           1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------- benchmark 'Complete load of data/twitter.json': 7 tests ------------------------------------------------------------------------
Name (time in us)            Min                    Max                  Mean                StdDev                Median                IQR            Outliers       OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
orjson                  836.8610 (1.0)      10,329.4210 (1.10)     1,049.1258 (1.0)      1,139.4469 (1.36)       866.8420 (1.0)      35.2050 (1.17)        15;80  953.1746 (1.0)         687           1
yyjson                1,011.1430 (1.21)     13,724.8670 (1.46)     1,298.2750 (1.24)     1,638.2353 (1.96)     1,047.1840 (1.21)     39.9810 (1.33)        13;56  770.2528 (0.81)        610           1
msgspec               1,077.3750 (1.29)     10,071.5970 (1.07)     1,284.9237 (1.22)     1,096.0884 (1.31)     1,109.6350 (1.28)     30.0410 (1.0)         18;95  778.2563 (0.82)        805           1
simdjson              1,421.6790 (1.70)     13,269.0910 (1.41)     1,719.4686 (1.64)     1,539.5134 (1.84)     1,470.2000 (1.70)     56.9100 (1.89)        12;32  581.5750 (0.61)        510           1
rapidjson             2,114.6990 (2.53)     11,652.8590 (1.24)     2,372.3937 (2.26)     1,264.2486 (1.51)     2,171.6145 (2.51)     49.1255 (1.64)         8;20  421.5152 (0.44)        380           1
ujson                 2,215.4900 (2.65)     14,347.0150 (1.52)     2,542.0073 (2.42)     1,685.3860 (2.01)     2,277.9720 (2.63)     57.4060 (1.91)         9;28  393.3899 (0.41)        415           1
json                  2,607.9660 (3.12)      9,422.4880 (1.0)      2,846.9605 (2.71)       836.7199 (1.0)      2,701.6265 (3.12)     61.5915 (2.05)         8;24  351.2518 (0.37)        356           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------- benchmark 'Complete load of data/verysmall.json': 7 tests ---------------------------------------------------------------------
Name (time in ns)          Min                    Max                Mean              StdDev              Median                IQR             Outliers  OPS (Mops/s)            Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
msgspec                98.7001 (1.0)       2,105.2299 (5.32)     104.6280 (1.0)        8.3296 (1.75)     104.0997 (1.0)       0.9101 (1.0)      1319;3002        9.5577 (1.0)       96526         100
orjson                109.3099 (1.11)        395.5103 (1.0)      115.4680 (1.10)       4.7556 (1.0)      114.8999 (1.10)      1.3001 (1.43)     1542;4401        8.6604 (0.91)      83265         100
yyjson                225.0003 (2.28)      1,332.5494 (3.37)     233.1583 (2.23)      15.8932 (3.34)     231.9997 (2.23)      2.4986 (2.75)     1334;7944        4.2889 (0.45)     195313          20
ujson                 258.9460 (2.62)      8,495.8952 (21.48)    274.3283 (2.62)      32.6612 (6.87)     272.1055 (2.61)      7.3679 (8.10)     3028;3090        3.6453 (0.38)     190476          19
rapidjson             289.9991 (2.94)      1,950.0576 (4.93)     305.4173 (2.92)      29.1320 (6.13)     301.7656 (2.90)      5.2353 (5.75)     3001;3901        3.2742 (0.34)     193050          17
simdjson              410.5503 (4.16)      5,258.1003 (13.29)    434.4098 (4.15)      83.5433 (17.57)    428.0009 (4.11)      6.9995 (7.69)     2207;3136        2.3020 (0.24)     108814          20
json                  830.0121 (8.41)     15,410.0126 (38.96)    937.3787 (8.96)     169.8230 (35.71)    920.0012 (8.84)     39.9887 (43.94)    2488;4301        1.0668 (0.11)     181818           1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------- benchmark 'Merge Patch': 2 tests ---------------------------------------------------------------------------------
Name (time in ns)          Min                    Max                Mean              StdDev              Median                IQR             Outliers  OPS (Mops/s)            Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
yyjson                381.5003 (1.0)       2,371.0498 (1.0)      403.1958 (1.0)       42.7448 (1.0)      398.9990 (1.0)       7.9992 (1.0)      2649;2705        2.4802 (1.0)      109398          20
json_merge_patch      500.0038 (1.31)     62,561.0119 (26.39)    595.0156 (1.48)     241.6010 (5.65)     580.0102 (1.45)     30.0060 (3.75)     3592;6235        1.6806 (0.68)     181819           1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

@TkTech TkTech merged commit 5dbc1bf into master May 18, 2025
18 checks passed
@TkTech TkTech deleted the draft_7 branch May 18, 2025 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants