Skip to main content

Benchmark for ssrJSON

Project description

ssrJSON-benchmark

The ssrJSON benchmark repository.

Benchmark Results

The benchmark results can be found in results. Contributing your benchmark result is welcomed.

Quick jump for

Usage

To generate a benchmark report, you need to install ssrJSON either by fetched PyPi or built from source, and toolkit(ssrjson_benchmark) from this repo by:

python -m build
pip install dist/*.whl

Then run the benchmark script:

python benchmark.py

Benchmark options

  • -m output in Markdown instead of PDF.
  • -f <json_path> used exists benchmark json result.
  • --process-bytes <bytes_num> Total process bytes per test, default 1e8.

Notes

  • This repository conducts benchmarking using json, orjson, and ssrJSON. The dumps benchmark produces str objects, comparing three operations: json.dumps, orjson.dumps followed by decode, and ssrjson.dumps. The dumps_to_bytes benchmark produces bytes objects, comparing three functions: json.dumps followed by encode, orjson.dumps, and ssrjson.dumps_to_bytes.

  • The ssrJSON built with the BUILD_BENCHMARK option includes several additional C functions specifically designed for executing benchmarks. These functions utilize high-precision timing APIs, and within the loop, only the time spent on the actual PyObject_Call invocations is measured.

  • When orjson handles non-ASCII strings, if the cache of the PyUnicodeObject’s UTF-8 representation does not exist, it invokes the PyUnicode_AsUTF8AndSize function to obtain the UTF-8 encoding. This function then caches the UTF-8 representation within the PyUnicodeObject. If the same PyUnicodeObject undergoes repeated encode-decode operations, subsequent calls after the initial one will execute more quickly due to this caching. However, in real-world production scenarios, it is uncommon to perform JSON encode-decode repeatedly on the exact same string object; even identical strings are unlikely to be the same object instance. To achieve benchmark results that better reflect practical use cases, we employ ssrjson.run_unicode_accumulate_benchmark and benchmark_invalidate_dump_cache functions, which ensure that new PyUnicodeObjects are different for each input every time.

  • The performance of JSON encoding is primarily constrained by the speed of writing to the buffer, whereas decoding performance is mainly limited by the frequent invocation of CPython interfaces for object creation. During decoding, both ssrJSON and orjson employ short key caching to reduce the number of object creations, and this caching mechanism is global in both cases. As a result, decoding benchmark tests may not accurately reflect the conditions encountered in real-world production environments.

  • The files simple_object.json and simple_object_zh.json do not represent real-world data; they are solely used to compare the performance of the fast path. Therefore, the benchmark results should not be interpreted as indicative of actual performance.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssrjson_benchmark-0.0.1a0.tar.gz (3.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ssrjson_benchmark-0.0.1a0-cp313-cp313-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.13Windows x86-64

ssrjson_benchmark-0.0.1a0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

ssrjson_benchmark-0.0.1a0-cp312-cp312-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.12Windows x86-64

ssrjson_benchmark-0.0.1a0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ssrjson_benchmark-0.0.1a0-cp311-cp311-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.11Windows x86-64

ssrjson_benchmark-0.0.1a0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ssrjson_benchmark-0.0.1a0-cp310-cp310-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.10Windows x86-64

ssrjson_benchmark-0.0.1a0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ssrjson_benchmark-0.0.1a0-cp39-cp39-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.9Windows x86-64

ssrjson_benchmark-0.0.1a0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

Details for the file ssrjson_benchmark-0.0.1a0.tar.gz.

File metadata

  • Download URL: ssrjson_benchmark-0.0.1a0.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ssrjson_benchmark-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 3f1520b4a4bc68c2272c395ddeb24e5c1fbc28e8781a376765a08cac9567f643
MD5 b480978852e25967decdb258b8fd2978
BLAKE2b-256 9c286007606afebc13bc882c68ba6ab54bc17823d522c6e31b5359eb07df97b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssrjson_benchmark-0.0.1a0.tar.gz:

Publisher: release-wheel.yaml on Nambers/ssrJSON-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssrjson_benchmark-0.0.1a0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for ssrjson_benchmark-0.0.1a0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7aa47889f57b04379ee4210b58e988f91a5fdf910be69e85a9f03542b8ac9960
MD5 1d0be07e7d39bf0ddea46a324ad2ad78
BLAKE2b-256 a42915c2b32402c4c587650f17fa1735c432524f63ef6491cbf21d2c329c17d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssrjson_benchmark-0.0.1a0-cp313-cp313-win_amd64.whl:

Publisher: release-wheel.yaml on Nambers/ssrJSON-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssrjson_benchmark-0.0.1a0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ssrjson_benchmark-0.0.1a0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 864a196373f0ab96564c9cc890f0930505cc46195b847e8f3aa17ce4b9286a95
MD5 d940c96ac2887124af05e075f2557254
BLAKE2b-256 d66f8aee54663a569dd28d4412668f5dc8612e0ec84a4d525dd79970af6d9625

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssrjson_benchmark-0.0.1a0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: release-wheel.yaml on Nambers/ssrJSON-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssrjson_benchmark-0.0.1a0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for ssrjson_benchmark-0.0.1a0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 39f5ac693cefafa39e51972c0d6a1f8ff8e3b153b7f0d8b71ece156ae216145d
MD5 856ce3753037a4ffeef11822bbaae791
BLAKE2b-256 cea36f38ee8fc4749cb45434332368d8f20141f5532df2e26d946cd4b739f34e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssrjson_benchmark-0.0.1a0-cp312-cp312-win_amd64.whl:

Publisher: release-wheel.yaml on Nambers/ssrJSON-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssrjson_benchmark-0.0.1a0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ssrjson_benchmark-0.0.1a0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 acf7ec351d862b22264684ef0f0718171f0a1f8d1edbeb3f4e29b4cb9cc4af77
MD5 24bdfe090e47fa35d4e7f1eb95c7ccb0
BLAKE2b-256 da672f943878f38be2f3059ca5668d3e1c936a04a443538f8d3feba2cecfc667

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssrjson_benchmark-0.0.1a0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: release-wheel.yaml on Nambers/ssrJSON-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssrjson_benchmark-0.0.1a0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for ssrjson_benchmark-0.0.1a0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 50399e82940bc066345ad5535d0aad335dca06e132e4ac468cede786365e2760
MD5 3c82fe02d124b2fad718d4f6876f84c7
BLAKE2b-256 11a71b28b8e556f90be71727024219b73f4660505f06b7479448998054b299c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssrjson_benchmark-0.0.1a0-cp311-cp311-win_amd64.whl:

Publisher: release-wheel.yaml on Nambers/ssrJSON-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssrjson_benchmark-0.0.1a0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ssrjson_benchmark-0.0.1a0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 564be48a2fa6c7c39d6758c159dd00a9e11979636b3e8e42e755e8a696f6cef8
MD5 497cfe7b77bd31c608ded1a1d0246b25
BLAKE2b-256 14a40b182285dce2fbb387c55b2725c5fde51138e0a854a1d823a058f93280c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssrjson_benchmark-0.0.1a0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: release-wheel.yaml on Nambers/ssrJSON-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssrjson_benchmark-0.0.1a0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for ssrjson_benchmark-0.0.1a0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a27c993ec8ded2ab2bb8e0a3713743dce63854125f2bf71ebe6a59d0fafb17d0
MD5 41a23c5dc8982c1a4935f9302f832727
BLAKE2b-256 6d36189cb78a031d6896afaffd38adf4f4f5b022094c1ede7222c607fc977ac8

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssrjson_benchmark-0.0.1a0-cp310-cp310-win_amd64.whl:

Publisher: release-wheel.yaml on Nambers/ssrJSON-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssrjson_benchmark-0.0.1a0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ssrjson_benchmark-0.0.1a0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 dde5311de7335343140bfefb93e0d27497a6d549087ee5aab832773cc0aa75f9
MD5 414edb759e6e9bda6b05e8dad82e5505
BLAKE2b-256 f14e33cdcccaaef8d4dc253a815eedc41bf768c8e7c46f381219dc51da458e4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssrjson_benchmark-0.0.1a0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: release-wheel.yaml on Nambers/ssrJSON-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssrjson_benchmark-0.0.1a0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for ssrjson_benchmark-0.0.1a0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4249a228bb926617d0f3d17a5166bed47b227563722fc8e9e577d8c1688bceb5
MD5 fbfedc81d1b5c3b11b01ac96dd0364ec
BLAKE2b-256 a4b2755ba968a8a40822827f97c2a13b59753633765c4cdacd26af239000484d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssrjson_benchmark-0.0.1a0-cp39-cp39-win_amd64.whl:

Publisher: release-wheel.yaml on Nambers/ssrJSON-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssrjson_benchmark-0.0.1a0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ssrjson_benchmark-0.0.1a0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d80bbe8d0de9a6d19216448dce32b5febc9b747817cd48fa6f73a0de128ae492
MD5 c448c956fe3372929cd7a020883142ba
BLAKE2b-256 36af0feb617bfeeb1bf095e1c623d94106406b2a9c2e67e2e087ba4e6a52d779

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssrjson_benchmark-0.0.1a0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: release-wheel.yaml on Nambers/ssrJSON-benchmark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page