python-rapidjson 1.16__tar.gz → 1.18__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python-rapidjson-1.16 → python-rapidjson-1.18}/CHANGES.rst +21 -1
- {python-rapidjson-1.16 → python-rapidjson-1.18}/LICENSE +1 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/MANIFEST.in +1 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/PKG-INFO +22 -2
- {python-rapidjson-1.16 → python-rapidjson-1.18}/benchmarks/conftest.py +30 -2
- {python-rapidjson-1.16 → python-rapidjson-1.18}/benchmarks/tablize.py +38 -26
- python-rapidjson-1.18/docs/benchmarks-tables.rst +123 -0
- python-rapidjson-1.18/docs/changes.rst +635 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/conf.py +3 -3
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/decoder.rst +3 -3
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/index.rst +2 -1
- {python-rapidjson-1.16 → python-rapidjson-1.18}/python_rapidjson.egg-info/PKG-INFO +22 -2
- {python-rapidjson-1.16 → python-rapidjson-1.18}/python_rapidjson.egg-info/SOURCES.txt +3 -1
- python-rapidjson-1.18/python_rapidjson.egg-info/top_level.txt +2 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/allocators.h +2 -2
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/document.h +2 -2
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/regex.h +1 -1
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/rapidjson.h +1 -1
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/schema.h +12 -10
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/writer.h +1 -1
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson.cpp +8 -2
- python-rapidjson-1.18/rapidjson_exact_version.txt +1 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/requirements-test.txt +1 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/requirements.txt +7 -8
- {python-rapidjson-1.16 → python-rapidjson-1.18}/setup.py +4 -0
- python-rapidjson-1.18/typings/rapidjson/__init__.pyi +232 -0
- python-rapidjson-1.18/version.txt +1 -0
- python-rapidjson-1.16/docs/benchmarks-tables.rst +0 -121
- python-rapidjson-1.16/python_rapidjson.egg-info/top_level.txt +0 -1
- python-rapidjson-1.16/rapidjson_exact_version.txt +0 -1
- python-rapidjson-1.16/version.txt +0 -1
- {python-rapidjson-1.16 → python-rapidjson-1.18}/.dir-locals.el +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/README.rst +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/benchmarks/test_benchmark.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/Makefile +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/api.rst +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/benchmarks.rst +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/dump.rst +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/dumps.rst +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/encoder.rst +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/load.rst +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/loads.rst +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/quickstart.rst +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/rawjson.rst +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/docs/validator.rst +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/python_rapidjson.egg-info/dependency_links.txt +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/cursorstreamwrapper.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/encodedstream.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/encodings.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/error/en.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/error/error.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/filereadstream.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/filewritestream.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/fwd.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/biginteger.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/clzll.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/diyfp.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/dtoa.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/ieee754.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/itoa.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/meta.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/pow10.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/stack.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/strfunc.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/strtod.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/internal/swap.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/istreamwrapper.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/memorybuffer.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/memorystream.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/msinttypes/inttypes.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/msinttypes/stdint.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/ostreamwrapper.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/pointer.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/prettywriter.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/reader.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/stream.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/stringbuffer.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/include/rapidjson/uri.h +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/license.txt +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/rapidjson/readme.md +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/setup.cfg +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/conftest.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_base_types.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_circular.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_dict_subclass.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_enum.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_float.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_memory_leaks.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_params.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_pass1.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_pass2.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_pass3.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_rawjson.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_refs_count.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_streams.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_unicode.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tests/test_validator.py +0 -0
- {python-rapidjson-1.16 → python-rapidjson-1.18}/tox.ini +0 -0
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
Changes
|
|
2
2
|
-------
|
|
3
3
|
|
|
4
|
+
1.18 (2024-06-29)
|
|
5
|
+
~~~~~~~~~~~~~~~~~
|
|
6
|
+
|
|
7
|
+
* Expose PEP-484 typing stubs, thanks to Rodion Kosianenko and GoodWasHere (`PR #204`__)
|
|
8
|
+
|
|
9
|
+
__ https://github.com/python-rapidjson/python-rapidjson/pull/204
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
1.17 (2024-05-18)
|
|
13
|
+
~~~~~~~~~~~~~~~~~
|
|
14
|
+
|
|
15
|
+
* Use `current master`__ version of rapidjson
|
|
16
|
+
|
|
17
|
+
__ https://github.com/Tencent/rapidjson/compare/5e17dbed34eef33af8f3e734820b5dc547a2a3aa...ab1842a2dae061284c0a62dca1cc6d5e7e37e346
|
|
18
|
+
|
|
19
|
+
* Generate wheels on PyPI using Python 3.13b1 release, thanks to cibuildwheel `2.18.0`__
|
|
20
|
+
|
|
21
|
+
__ https://cibuildwheel.pypa.io/en/stable/changelog/#v2180
|
|
22
|
+
|
|
23
|
+
|
|
4
24
|
1.16 (2024-02-28)
|
|
5
25
|
~~~~~~~~~~~~~~~~~
|
|
6
26
|
|
|
@@ -47,7 +67,7 @@ Changes
|
|
|
47
67
|
|
|
48
68
|
* Use `current master`__ version of rapidjson
|
|
49
69
|
|
|
50
|
-
__ https://github.com/Tencent/rapidjson/compare/083f359f5c36198accc2b9360ce1e32a333231d9...
|
|
70
|
+
__ https://github.com/Tencent/rapidjson/compare/083f359f5c36198accc2b9360ce1e32a333231d9...5e17dbed34eef33af8f3e734820b5dc547a2a3aa
|
|
51
71
|
|
|
52
72
|
* Use cibuildwheel `2.15.0`__
|
|
53
73
|
|
|
@@ -3,6 +3,7 @@ python-rapidjson is licensed under the MIT license.
|
|
|
3
3
|
The MIT License (MIT)
|
|
4
4
|
|
|
5
5
|
Copyright (c) 2015, 2016, 2017 Ken Robbins
|
|
6
|
+
Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Lele Gaifax
|
|
6
7
|
|
|
7
8
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
9
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-rapidjson
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.18
|
|
4
4
|
Summary: Python wrapper around rapidjson
|
|
5
5
|
Home-page: https://github.com/python-rapidjson/python-rapidjson
|
|
6
6
|
Author: Ken Robbins
|
|
@@ -155,6 +155,26 @@ __ https://python-rapidjson.readthedocs.io/en/latest/quickstart.html#incompatibi
|
|
|
155
155
|
Changes
|
|
156
156
|
-------
|
|
157
157
|
|
|
158
|
+
1.18 (2024-06-29)
|
|
159
|
+
~~~~~~~~~~~~~~~~~
|
|
160
|
+
|
|
161
|
+
* Expose PEP-484 typing stubs, thanks to Rodion Kosianenko and GoodWasHere (`PR #204`__)
|
|
162
|
+
|
|
163
|
+
__ https://github.com/python-rapidjson/python-rapidjson/pull/204
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
1.17 (2024-05-18)
|
|
167
|
+
~~~~~~~~~~~~~~~~~
|
|
168
|
+
|
|
169
|
+
* Use `current master`__ version of rapidjson
|
|
170
|
+
|
|
171
|
+
__ https://github.com/Tencent/rapidjson/compare/5e17dbed34eef33af8f3e734820b5dc547a2a3aa...ab1842a2dae061284c0a62dca1cc6d5e7e37e346
|
|
172
|
+
|
|
173
|
+
* Generate wheels on PyPI using Python 3.13b1 release, thanks to cibuildwheel `2.18.0`__
|
|
174
|
+
|
|
175
|
+
__ https://cibuildwheel.pypa.io/en/stable/changelog/#v2180
|
|
176
|
+
|
|
177
|
+
|
|
158
178
|
1.16 (2024-02-28)
|
|
159
179
|
~~~~~~~~~~~~~~~~~
|
|
160
180
|
|
|
@@ -201,7 +221,7 @@ Changes
|
|
|
201
221
|
|
|
202
222
|
* Use `current master`__ version of rapidjson
|
|
203
223
|
|
|
204
|
-
__ https://github.com/Tencent/rapidjson/compare/083f359f5c36198accc2b9360ce1e32a333231d9...
|
|
224
|
+
__ https://github.com/Tencent/rapidjson/compare/083f359f5c36198accc2b9360ce1e32a333231d9...5e17dbed34eef33af8f3e734820b5dc547a2a3aa
|
|
205
225
|
|
|
206
226
|
* Use cibuildwheel `2.15.0`__
|
|
207
227
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# :Project: python-rapidjson -- Benchmarks specific pytest configuration
|
|
3
3
|
# :Author: Lele Gaifax <lele@metapensiero.it>
|
|
4
4
|
# :License: MIT License
|
|
5
|
-
# :Copyright: © 2016, 2017, 2018, 2020 Lele Gaifax
|
|
5
|
+
# :Copyright: © 2016, 2017, 2018, 2020, 2024 Lele Gaifax
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
from collections import namedtuple
|
|
@@ -56,6 +56,32 @@ contenders.append(Contender('rapidjson_nn_c',
|
|
|
56
56
|
rj.Encoder(number_mode=rj.NM_NATIVE),
|
|
57
57
|
rj.Decoder(number_mode=rj.NM_NATIVE)))
|
|
58
58
|
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class DecoderPython(rj.Decoder):
|
|
62
|
+
def end_array(self, a):
|
|
63
|
+
return a
|
|
64
|
+
|
|
65
|
+
def start_object(self):
|
|
66
|
+
return {}
|
|
67
|
+
|
|
68
|
+
def end_object(self, d):
|
|
69
|
+
return d
|
|
70
|
+
|
|
71
|
+
def string(self, s):
|
|
72
|
+
return s
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class EncoderPython(rj.Encoder):
|
|
76
|
+
def default(self, obj):
|
|
77
|
+
return repr(obj)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
contenders.append(Contender('rapidjson_p',
|
|
81
|
+
EncoderPython(),
|
|
82
|
+
DecoderPython()))
|
|
83
|
+
|
|
84
|
+
|
|
59
85
|
numbers_contenders = [
|
|
60
86
|
Contender('Wide numbers', rj.dumps, rj.loads),
|
|
61
87
|
Contender('Native numbers',
|
|
@@ -147,7 +173,9 @@ def pytest_generate_tests(metafunc):
|
|
|
147
173
|
if metafunc.config.option.compare_other_engines:
|
|
148
174
|
metafunc.parametrize('contender', contenders, ids=attrgetter('name'))
|
|
149
175
|
else:
|
|
150
|
-
metafunc.parametrize('contender',
|
|
176
|
+
metafunc.parametrize('contender', [c for c in contenders
|
|
177
|
+
if c.name.startswith('rapidjson')],
|
|
178
|
+
ids=attrgetter('name'))
|
|
151
179
|
|
|
152
180
|
if 'datetimes_loads_contender' in metafunc.fixturenames:
|
|
153
181
|
metafunc.parametrize('datetimes_loads_contender',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# :Project: python-rapidjson -- reST tables writer tool
|
|
3
3
|
# :Author: Lele Gaifax <lele@metapensiero.it>
|
|
4
4
|
# :License: MIT License
|
|
5
|
-
# :Copyright: © 2017, 2018, 2020, 2021, 2022 Lele Gaifax
|
|
5
|
+
# :Copyright: © 2017, 2018, 2020, 2021, 2022, 2024 Lele Gaifax
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
# Assume we did::
|
|
@@ -70,7 +70,7 @@ class Comparison:
|
|
|
70
70
|
cells = ['=' * (width+2) for width in widths]
|
|
71
71
|
headseprow = '+' + '+'.join(cells) + '+'
|
|
72
72
|
|
|
73
|
-
cells = [' {
|
|
73
|
+
cells = [f' {{:^{width}}} ' for width in widths]
|
|
74
74
|
rowfmt = '|' + '|'.join(cells) + '|'
|
|
75
75
|
|
|
76
76
|
print(seprow)
|
|
@@ -95,6 +95,7 @@ def dumps_and_loads(benchmarks):
|
|
|
95
95
|
'rapidjson_c',
|
|
96
96
|
'rapidjson_nn_f',
|
|
97
97
|
'rapidjson_nn_c',
|
|
98
|
+
'rapidjson_p',
|
|
98
99
|
'simdjson',
|
|
99
100
|
'orjson',
|
|
100
101
|
'ujson',
|
|
@@ -104,15 +105,17 @@ def dumps_and_loads(benchmarks):
|
|
|
104
105
|
r'``Encoder()``\ [2]_',
|
|
105
106
|
r'``dumps(n)``\ [3]_',
|
|
106
107
|
r'``Encoder(n)``\ [4]_',
|
|
107
|
-
r'
|
|
108
|
-
r'
|
|
109
|
-
r'
|
|
110
|
-
r'
|
|
111
|
-
r'
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
r'``
|
|
115
|
-
r'``
|
|
108
|
+
r'``PyEncoder()``\ [5]_',
|
|
109
|
+
r'simdjson\ [6]_',
|
|
110
|
+
r'orjson\ [7]_',
|
|
111
|
+
r'ujson\ [8]_',
|
|
112
|
+
r'simplejson\ [9]_',
|
|
113
|
+
r'stdlib\ [10]_')
|
|
114
|
+
d_headers = (r'``loads()``\ [11]_',
|
|
115
|
+
r'``Decoder()``\ [12]_',
|
|
116
|
+
r'``loads(n)``\ [13]_',
|
|
117
|
+
r'``Decoder(n)``\ [14]_',
|
|
118
|
+
r'``PyDecoder()``\ [15]_',
|
|
116
119
|
r'simdjson',
|
|
117
120
|
r'orjson',
|
|
118
121
|
r'ujson',
|
|
@@ -121,20 +124,29 @@ def dumps_and_loads(benchmarks):
|
|
|
121
124
|
|
|
122
125
|
assert len(contenders) == len(s_headers) == len(d_headers)
|
|
123
126
|
|
|
127
|
+
from csimdjson import VERSION as simdjv
|
|
128
|
+
from orjson import __version__ as orjv
|
|
129
|
+
from simplejson import __version__ as sjv
|
|
130
|
+
from ujson import __version__ as ujv
|
|
131
|
+
|
|
132
|
+
pyv = '%d.%d.%d' % sys.version_info[:3]
|
|
133
|
+
|
|
124
134
|
footnotes = [
|
|
125
135
|
'.. [1] ``rapidjson.dumps()``',
|
|
126
136
|
'.. [2] ``rapidjson.Encoder()``',
|
|
127
137
|
'.. [3] ``rapidjson.dumps(number_mode=NM_NATIVE)``',
|
|
128
138
|
'.. [4] ``rapidjson.Encoder(number_mode=NM_NATIVE)``',
|
|
129
|
-
'.. [5]
|
|
130
|
-
'.. [6] `
|
|
131
|
-
'.. [7] `
|
|
132
|
-
'.. [8] `
|
|
133
|
-
'.. [9]
|
|
134
|
-
'.. [10] ``
|
|
135
|
-
'.. [11] ``rapidjson.
|
|
136
|
-
'.. [12] ``rapidjson.
|
|
137
|
-
'.. [13] ``rapidjson.
|
|
139
|
+
'.. [5] ``rapidjson.Encoder()`` subclassed in Python with *no-op* hook methods',
|
|
140
|
+
f'.. [6] `simdjson {simdjv} <https://pypi.org/project/pysimdjson/>`__',
|
|
141
|
+
f'.. [7] `orjson {orjv} <https://pypi.org/project/orjson/{orjv}/>`__',
|
|
142
|
+
f'.. [8] `ujson {ujv} <https://pypi.org/project/ujson/{ujv}/>`__',
|
|
143
|
+
f'.. [9] `simplejson {sjv} <https://pypi.org/pypi/simplejson/{sjv}>`__',
|
|
144
|
+
f'.. [10] Python {pyv} standard library ``json``',
|
|
145
|
+
'.. [11] ``rapidjson.loads()``',
|
|
146
|
+
'.. [12] ``rapidjson.Decoder()``',
|
|
147
|
+
'.. [13] ``rapidjson.loads(number_mode=NM_NATIVE)``',
|
|
148
|
+
'.. [14] ``rapidjson.Decoder(number_mode=NM_NATIVE)``',
|
|
149
|
+
'.. [15] ``rapidjson.Decoder() subclassed in Python with *no-op* hook methods``']
|
|
138
150
|
|
|
139
151
|
comparison = Comparison(contenders, benchmarks)
|
|
140
152
|
|
|
@@ -157,17 +169,17 @@ def ascii_vs_utf8(benchmarks):
|
|
|
157
169
|
('ujson', 'uj'),
|
|
158
170
|
('simplejson', 'sj'),
|
|
159
171
|
('stdlib json', 'json'))
|
|
160
|
-
contenders = ['
|
|
161
|
-
i =
|
|
172
|
+
contenders = [f'{e[0]} {k}' for e in engines for k in ('ascii', 'utf8')]
|
|
173
|
+
i = 15
|
|
162
174
|
s_headers = []
|
|
163
175
|
footnotes = []
|
|
164
176
|
for e in engines:
|
|
165
177
|
i += 1
|
|
166
|
-
s_headers.append(
|
|
167
|
-
footnotes.append('.. [
|
|
178
|
+
s_headers.append(rf'``{e[1]} ascii``\ [{i}]_')
|
|
179
|
+
footnotes.append(f'.. [{i}] ``{e[0]}.dumps(ensure_ascii=True)``')
|
|
168
180
|
i += 1
|
|
169
|
-
s_headers.append(
|
|
170
|
-
footnotes.append('.. [
|
|
181
|
+
s_headers.append(rf'``{e[1]} utf8``\ [{i}]_')
|
|
182
|
+
footnotes.append(f'.. [{i}] ``{e[0]}.dumps(ensure_ascii=False)``')
|
|
171
183
|
|
|
172
184
|
comparison = Comparison(contenders, benchmarks)
|
|
173
185
|
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
|
|
2
|
+
Serialization
|
|
3
|
+
~~~~~~~~~~~~~
|
|
4
|
+
|
|
5
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
6
|
+
| serialize | ``dumps()``\ [1]_ | ``Encoder()``\ [2]_ | ``dumps(n)``\ [3]_ | ``Encoder(n)``\ [4]_ | ``PyEncoder()``\ [5]_ | simdjson\ [6]_ | orjson\ [7]_ | ujson\ [8]_ | simplejson\ [9]_ | stdlib\ [10]_ |
|
|
7
|
+
+=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+
|
|
8
|
+
| 100 arrays dict | 1.00 | 1.00 | 0.73 | 0.73 | 0.99 | 2.21 | **0.17** | 0.85 | 5.93 | 2.31 |
|
|
9
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
10
|
+
| 100 dicts array | 1.00 | 0.99 | 0.77 | 0.74 | 1.01 | 2.27 | **0.22** | 0.84 | 6.82 | 2.27 |
|
|
11
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
12
|
+
| 256 Trues array | 1.00 | 1.01 | 1.18 | 1.00 | 1.07 | 2.62 | **0.36** | 1.56 | 2.95 | 2.60 |
|
|
13
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
14
|
+
| 256 ascii array | 1.00 | 1.00 | 1.01 | 1.00 | 1.00 | 0.90 | **0.09** | 0.47 | 1.05 | 0.90 |
|
|
15
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
16
|
+
| 256 doubles array | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 0.91 | **0.04** | 0.22 | 0.95 | 0.92 |
|
|
17
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
18
|
+
| 256 unicode array | 1.00 | 0.80 | 0.79 | 0.82 | 0.80 | 0.68 | **0.02** | 0.52 | 0.66 | 0.68 |
|
|
19
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
20
|
+
| apache.json | 1.00 | 1.00 | 1.00 | 1.00 | 1.01 | 1.70 | **0.19** | 1.02 | 3.29 | 1.68 |
|
|
21
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
22
|
+
| canada.json | 1.00 | 1.00 | 0.98 | 0.99 | 1.00 | 1.04 | **0.06** | 0.27 | 1.81 | 1.05 |
|
|
23
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
24
|
+
| complex object | 1.00 | 1.00 | 0.89 | 0.88 | 1.00 | 1.55 | **0.17** | 0.66 | 2.68 | 1.54 |
|
|
25
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
26
|
+
| composite object | 1.00 | 0.99 | 0.68 | 0.64 | 0.98 | 1.70 | **0.21** | 0.83 | 2.48 | 1.72 |
|
|
27
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
28
|
+
| ctm.json | 1.00 | 1.00 | 0.75 | 0.75 | 1.00 | 2.27 | **0.21** | 1.11 | 6.56 | 2.27 |
|
|
29
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
30
|
+
| github.json | 1.00 | 1.00 | 0.97 | 0.96 | 1.00 | 1.38 | **0.16** | 0.86 | 2.10 | 1.39 |
|
|
31
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
32
|
+
| instruments.json | 1.00 | 1.00 | 0.74 | 0.74 | 1.00 | 1.81 | **0.20** | 0.90 | 2.86 | 1.81 |
|
|
33
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
34
|
+
| mesh.json | 1.00 | 1.00 | 0.89 | 0.89 | 1.00 | 0.94 | **0.10** | 0.28 | 1.19 | 0.94 |
|
|
35
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
36
|
+
| truenull.json | 1.00 | 1.02 | 1.06 | 1.03 | 1.03 | 2.13 | **0.28** | 1.76 | 2.12 | 2.21 |
|
|
37
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
38
|
+
| tweet.json | 1.00 | 1.00 | 0.99 | 0.93 | 1.00 | 1.70 | **0.20** | 0.91 | 2.70 | 1.69 |
|
|
39
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
40
|
+
| twitter.json | 1.00 | 1.00 | 0.95 | 0.95 | 1.00 | 1.46 | **0.18** | 0.94 | 2.02 | 1.46 |
|
|
41
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
42
|
+
| overall | 1.00 | 1.00 | 0.80 | 0.80 | 1.00 | 1.85 | **0.14** | 0.68 | 4.63 | 1.92 |
|
|
43
|
+
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
44
|
+
|
|
45
|
+
Deserialization
|
|
46
|
+
~~~~~~~~~~~~~~~
|
|
47
|
+
|
|
48
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
49
|
+
| deserialize | ``loads()``\ [11]_ | ``Decoder()``\ [12]_ | ``loads(n)``\ [13]_ | ``Decoder(n)``\ [14]_ | ``PyDecoder()``\ [15]_ | simdjson | orjson | ujson | simplejson | stdlib |
|
|
50
|
+
+=======================+========================+========================+========================+========================+========================+========================+========================+========================+========================+========================+
|
|
51
|
+
| 100 arrays dict | 1.00 | 1.01 | 0.98 | 0.93 | 1.59 | 0.86 | **0.56** | 0.85 | 1.20 | 0.94 |
|
|
52
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
53
|
+
| 100 dicts array | 1.00 | 1.00 | 0.87 | 0.86 | 1.58 | 0.62 | **0.36** | 0.69 | 1.35 | 1.00 |
|
|
54
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
55
|
+
| 256 Trues array | 1.00 | 1.02 | 1.08 | 0.98 | 1.14 | 0.93 | **0.42** | 0.96 | 1.53 | 1.37 |
|
|
56
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
57
|
+
| 256 ascii array | 1.00 | 1.00 | 0.99 | 0.99 | 1.50 | 0.50 | **0.33** | 0.85 | 0.86 | 0.77 |
|
|
58
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
59
|
+
| 256 doubles array | 1.00 | 1.00 | 0.26 | 0.26 | 1.01 | 0.21 | **0.16** | 0.61 | 1.08 | 1.03 |
|
|
60
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
61
|
+
| 256 unicode array | 1.00 | 1.00 | 1.00 | 1.00 | 1.07 | 1.12 | **0.41** | 0.82 | 4.06 | 1.45 |
|
|
62
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
63
|
+
| apache.json | 1.00 | 1.00 | 1.01 | 1.01 | 1.57 | 0.68 | **0.44** | 0.79 | 0.84 | 0.82 |
|
|
64
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
65
|
+
| canada.json | 1.00 | 1.00 | 0.33 | 0.33 | 1.12 | 0.29 | **0.25** | 0.54 | 0.97 | 0.96 |
|
|
66
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
67
|
+
| complex object | 1.00 | 1.00 | 0.84 | 0.83 | 1.31 | 0.68 | **0.35** | 0.78 | 1.15 | 0.96 |
|
|
68
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
69
|
+
| composite object | 1.00 | 1.00 | 0.84 | 0.83 | 1.34 | 0.61 | **0.39** | 0.59 | 1.45 | 1.07 |
|
|
70
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
71
|
+
| ctm.json | 1.00 | 0.99 | 0.93 | 0.93 | 1.48 | 0.80 | **0.53** | 1.13 | 1.20 | 0.97 |
|
|
72
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
73
|
+
| github.json | 1.00 | 1.00 | 0.99 | 0.98 | 1.37 | 0.66 | **0.39** | 0.77 | 0.91 | 0.82 |
|
|
74
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
75
|
+
| instruments.json | 1.00 | 1.00 | 0.87 | 0.87 | 1.23 | 0.66 | **0.36** | 0.76 | 1.17 | 0.94 |
|
|
76
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
77
|
+
| mesh.json | 1.00 | 1.00 | 0.52 | 0.51 | 1.04 | 0.43 | **0.33** | 0.66 | 1.48 | 1.04 |
|
|
78
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
79
|
+
| truenull.json | 1.00 | 1.01 | 1.01 | 0.99 | 1.01 | 0.58 | **0.34** | 0.87 | 0.99 | 0.95 |
|
|
80
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
81
|
+
| tweet.json | 1.00 | 1.01 | 0.99 | 0.97 | 1.30 | 0.69 | **0.39** | 0.84 | 1.17 | 0.99 |
|
|
82
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
83
|
+
| twitter.json | 1.00 | 1.00 | 0.97 | 0.97 | 1.25 | 0.68 | **0.39** | 0.85 | 0.99 | 0.89 |
|
|
84
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
85
|
+
| overall | 1.00 | 1.01 | 0.91 | 0.87 | 1.54 | 0.80 | **0.53** | 0.82 | 1.19 | 0.94 |
|
|
86
|
+
+-----------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+------------------------+
|
|
87
|
+
|
|
88
|
+
ASCII vs UTF-8 Serialization
|
|
89
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
90
|
+
|
|
91
|
+
+-------------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
92
|
+
| serialize | ``rj ascii``\ [16]_ | ``rj utf8``\ [17]_ | ``uj ascii``\ [18]_ | ``uj utf8``\ [19]_ | ``sj ascii``\ [20]_ | ``sj utf8``\ [21]_ | ``json ascii``\ [22]_ | ``json utf8``\ [23]_ |
|
|
93
|
+
+=========================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+
|
|
94
|
+
| Long ASCII string | 1.00 | 0.43 | **0.24** | 0.29 | 0.60 | 1.24 | 0.57 | 1.00 |
|
|
95
|
+
+-------------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
96
|
+
| Long Unicode string | 1.00 | 0.57 | 0.64 | **0.47** | 0.72 | 0.62 | 0.76 | 0.48 |
|
|
97
|
+
+-------------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
98
|
+
| overall | 1.00 | 0.53 | 0.51 | **0.41** | 0.68 | 0.82 | 0.70 | 0.65 |
|
|
99
|
+
+-------------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
|
|
100
|
+
|
|
101
|
+
.. [1] ``rapidjson.dumps()``
|
|
102
|
+
.. [2] ``rapidjson.Encoder()``
|
|
103
|
+
.. [3] ``rapidjson.dumps(number_mode=NM_NATIVE)``
|
|
104
|
+
.. [4] ``rapidjson.Encoder(number_mode=NM_NATIVE)``
|
|
105
|
+
.. [5] ``rapidjson.Encoder()`` subclassed in Python with *no-op* hook methods
|
|
106
|
+
.. [6] `simdjson 3.6.4 <https://pypi.org/project/pysimdjson/>`__
|
|
107
|
+
.. [7] `orjson 3.10.5 <https://pypi.org/project/orjson/3.10.5/>`__
|
|
108
|
+
.. [8] `ujson 5.10.0 <https://pypi.org/project/ujson/5.10.0/>`__
|
|
109
|
+
.. [9] `simplejson 3.19.2 <https://pypi.org/pypi/simplejson/3.19.2>`__
|
|
110
|
+
.. [10] Python 3.11.9 standard library ``json``
|
|
111
|
+
.. [11] ``rapidjson.loads()``
|
|
112
|
+
.. [12] ``rapidjson.Decoder()``
|
|
113
|
+
.. [13] ``rapidjson.loads(number_mode=NM_NATIVE)``
|
|
114
|
+
.. [14] ``rapidjson.Decoder(number_mode=NM_NATIVE)``
|
|
115
|
+
.. [15] ``rapidjson.Decoder() subclassed in Python with *no-op* hook methods``
|
|
116
|
+
.. [16] ``rapidjson.dumps(ensure_ascii=True)``
|
|
117
|
+
.. [17] ``rapidjson.dumps(ensure_ascii=False)``
|
|
118
|
+
.. [18] ``ujson.dumps(ensure_ascii=True)``
|
|
119
|
+
.. [19] ``ujson.dumps(ensure_ascii=False)``
|
|
120
|
+
.. [20] ``simplejson.dumps(ensure_ascii=True)``
|
|
121
|
+
.. [21] ``simplejson.dumps(ensure_ascii=False)``
|
|
122
|
+
.. [22] ``stdlib json.dumps(ensure_ascii=True)``
|
|
123
|
+
.. [23] ``stdlib json.dumps(ensure_ascii=False)``
|