Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,23 @@ Serialization
+-----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| serialize | ``dumps()``\ [1]_ | ``Encoder()``\ [2]_ | ``dumps(n)``\ [3]_ | ``Encoder(n)``\ [4]_ | ujson\ [5]_ | simplejson\ [6]_ | stdlib\ [7]_ | yajl\ [8]_ |
+=======================+======================+======================+======================+======================+======================+======================+======================+======================+
| 100 arrays dict | 1.00 | 0.99 | **0.73** | 0.77 | 0.97 | 4.82 | 2.27 | 1.37 |
| 100 arrays dict | 1.00 | 0.99 | 0.63 | **0.63** | 0.88 | 3.97 | 2.24 | 1.39 |
+-----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| 100 dicts array | 1.00 | 1.02 | **0.82** | 0.85 | 0.90 | 5.68 | 2.19 | 1.36 |
| 100 dicts array | 1.00 | 1.04 | 0.73 | **0.70** | 0.87 | 5.79 | 2.31 | 1.36 |
+-----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| 256 Trues array | **1.00** | 1.04 | 1.24 | 1.09 | 1.31 | 2.41 | 2.04 | 1.12 |
| 256 Trues array | **1.00** | 1.08 | 1.23 | 1.09 | 1.35 | 3.55 | 2.31 | 1.32 |
+-----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| 256 ascii array | 1.00 | 1.01 | 1.04 | 1.09 | **0.49** | 1.01 | 0.95 | 1.08 |
| 256 ascii array | 1.00 | 1.01 | 1.04 | 1.03 | **0.51** | 1.17 | 1.04 | 1.12 |
+-----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| 256 doubles array | **1.00** | 1.02 | 1.08 | 1.03 | 6.76 | 7.34 | 6.88 | 3.89 |
| 256 doubles array | **1.00** | 1.02 | 1.06 | 1.02 | 7.45 | 8.18 | 7.69 | 4.34 |
+-----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| 256 unicode array | 1.00 | 0.89 | 0.89 | 0.91 | 0.56 | 0.73 | 0.83 | **0.47** |
| 256 unicode array | 1.00 | 0.88 | 0.88 | 0.88 | 0.55 | 0.74 | 0.67 | **0.51** |
+-----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| complex object | 1.00 | 1.01 | 0.85 | **0.82** | 1.04 | 4.11 | 2.62 | 2.16 |
| complex object | 1.00 | 1.02 | 0.81 | **0.79** | 1.13 | 3.98 | 2.84 | 2.21 |
+-----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| composite object | 1.00 | 1.02 | 0.72 | **0.68** | 0.88 | 2.79 | 1.82 | 1.71 |
| composite object | 1.00 | 1.00 | 0.69 | **0.65** | 0.98 | 3.12 | 1.99 | 2.00 |
+-----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| overall | 1.00 | 0.99 | **0.73** | 0.78 | 0.97 | 4.81 | 2.27 | 1.36 |
| overall | 1.00 | 0.99 | 0.63 | **0.63** | 0.88 | 3.97 | 2.24 | 1.39 |
+-----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+


Expand All @@ -136,32 +136,32 @@ Deserialization
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
| deserialize | ``loads()``\ [9]_ | ``Decoder()``\ [10]_ | ``loads(n)``\ [11]_ | ``Decoder(n)``\ [12]_ | ujson | simplejson | stdlib | yajl |
+=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+=======================+
| 100 arrays dict | 1.00 | 1.00 | 0.90 | **0.90** | 0.95 | 1.60 | 1.11 | 1.18 |
| 100 arrays dict | 1.00 | 1.00 | **0.90** | 0.90 | 0.96 | 1.40 | 1.12 | 1.15 |
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
| 100 dicts array | 1.00 | 1.04 | 0.86 | **0.86** | 0.94 | 2.00 | 1.43 | 1.27 |
| 100 dicts array | 1.00 | 1.04 | **0.87** | 0.88 | 0.94 | 1.95 | 1.61 | 1.25 |
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
| 256 Trues array | **1.00** | 1.16 | 1.10 | 1.12 | 1.20 | 1.95 | 1.90 | 1.89 |
| 256 Trues array | **1.00** | 1.24 | 1.17 | 1.25 | 1.16 | 2.09 | 1.87 | 1.86 |
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
| 256 ascii array | **1.00** | 1.02 | 1.02 | 1.02 | 1.39 | 1.14 | 1.25 | 1.62 |
| 256 ascii array | **1.00** | 1.03 | 1.04 | 1.05 | 1.41 | 1.31 | 1.24 | 1.49 |
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
| 256 doubles array | 1.00 | 0.90 | **0.16** | 0.16 | 0.39 | 0.86 | 0.83 | 0.42 |
| 256 doubles array | 1.00 | 1.01 | **0.19** | 0.19 | 0.44 | 0.91 | 0.85 | 0.56 |
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
| 256 unicode array | **1.00** | 1.01 | 1.01 | 1.00 | 1.02 | 5.14 | 5.34 | 2.40 |
| 256 unicode array | **1.00** | 1.01 | 1.01 | 1.01 | 1.27 | 5.46 | 6.17 | 3.04 |
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
| complex object | 1.00 | 1.01 | **0.73** | 0.73 | 0.88 | 1.60 | 1.14 | 1.20 |
| complex object | 1.00 | 1.02 | **0.78** | 0.79 | 0.99 | 1.60 | 1.19 | 1.22 |
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
| composite object | 1.00 | 1.02 | **0.81** | 0.81 | 0.85 | 1.97 | 1.42 | 1.26 |
| composite object | 1.00 | 1.01 | 0.80 | 0.81 | **0.76** | 2.06 | 1.38 | 1.29 |
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+
| overall | 1.00 | 1.00 | 0.90 | **0.90** | 0.95 | 1.61 | 1.12 | 1.18 |
| overall | 1.00 | 1.00 | **0.90** | 0.90 | 0.96 | 1.41 | 1.13 | 1.15 |
+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+-----------------------+

.. [1] ``rapidjson.dumps()``
.. [2] ``rapidjson.Encoder()``
.. [3] ``rapidjson.dumps(number_mode=NM_NATIVE)``
.. [4] ``rapidjson.Encoder(number_mode=NM_NATIVE)``
.. [5] `ujson 1.35 <https://pypi.python.org/pypi/ujson/1.35>`__
.. [6] `simplejson 3.11.1 <https://pypi.python.org/pypi/simplejson/3.11.1>`__
.. [7] Python 3.6.2 standard library ``json``
.. [6] `simplejson 3.13.2 <https://pypi.python.org/pypi/simplejson/3.13.2>`__
.. [7] Python 3.6.4 standard library ``json``
.. [8] `yajl 0.3.5 <https://pypi.python.org/pypi/yajl/0.3.5>`__
.. [9] ``rapidjson.loads()``
.. [10] ``rapidjson.Decoder()``
Expand Down
8 changes: 8 additions & 0 deletions benchmarks/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ def pytest_benchmark_group_stats(config, benchmarks, group_by):
return sorted(result.items())


# Remove parametrization data from JSON output to keep it to a reasonable size
# See https://github.com/ionelmc/pytest-benchmark/issues/96

def pytest_benchmark_update_json(config, benchmarks, output_json):
for benchmark in output_json['benchmarks']:
benchmark['params'].pop('data')


def pytest_addoption(parser):
parser.addoption('--compare-other-engines', action='store_true',
help='compare against other JSON engines')
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/tablize.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
'``rapidjson.dumps(number_mode=NM_NATIVE)``',
'``rapidjson.Encoder(number_mode=NM_NATIVE)``',
'`ujson 1.35 <https://pypi.python.org/pypi/ujson/1.35>`__',
'`simplejson 3.11.1 <https://pypi.python.org/pypi/simplejson/3.11.1>`__',
'`simplejson 3.13.2 <https://pypi.python.org/pypi/simplejson/3.13.2>`__',
'Python %d.%d.%d standard library ``json``' % sys.version_info[:3],
'`yajl 0.3.5 <https://pypi.python.org/pypi/yajl/0.3.5>`__',
'``rapidjson.loads()``',
Expand Down
Loading