ssrjson-benchmark 0.0.1a0__tar.gz → 0.0.1rc1__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.

Potentially problematic release.


This version of ssrjson-benchmark might be problematic. Click here for more details.

Files changed (31) hide show
  1. {ssrjson_benchmark-0.0.1a0/src/ssrjson_benchmark.egg-info → ssrjson_benchmark-0.0.1rc1}/PKG-INFO +28 -33
  2. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/README.md +14 -18
  3. ssrjson_benchmark-0.0.1rc1/pyproject.toml +28 -0
  4. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/benchmark.c +1 -1
  5. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/__init__.py +2 -0
  6. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/benchmark_main.py +1 -1
  7. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1/src/ssrjson_benchmark.egg-info}/PKG-INFO +28 -33
  8. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark.egg-info/SOURCES.txt +1 -1
  9. ssrjson_benchmark-0.0.1a0/src/ssrjson_benchmark.egg-info/requires.txt +0 -8
  10. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/CMakeLists.txt +0 -0
  11. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/LICENSE +0 -0
  12. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/MANIFEST.in +0 -0
  13. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/cmake/XcodeProperty.cmake +0 -0
  14. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/setup.cfg +0 -0
  15. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/setup.py +0 -0
  16. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/__main__.py +0 -0
  17. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/MotionsQuestionsAnswersQuestions2016.json +0 -0
  18. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/apache.json +0 -0
  19. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/canada.json +0 -0
  20. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/ctm.json +0 -0
  21. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/github.json +0 -0
  22. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/instruments.json +0 -0
  23. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/mesh.json +0 -0
  24. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/simple_object.json +0 -0
  25. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/simple_object_zh.json +0 -0
  26. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/truenull.json +0 -0
  27. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/tweet.json +0 -0
  28. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/_files/twitter.json +0 -0
  29. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark/template.md +0 -0
  30. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark.egg-info/dependency_links.txt +0 -0
  31. {ssrjson_benchmark-0.0.1a0 → ssrjson_benchmark-0.0.1rc1}/src/ssrjson_benchmark.egg-info/top_level.txt +0 -0
@@ -1,50 +1,48 @@
1
1
  Metadata-Version: 2.4
2
- Name: ssrjson_benchmark
3
- Version: 0.0.1a0
4
- Summary: Benchmark for ssrJSON
2
+ Name: ssrjson-benchmark
3
+ Version: 0.0.1rc1
4
+ Summary: benchmark of ssrJSON
5
+ Author-email: Eritque Arcus <eritque-arcus@ikuyo.dev>, Antares <antares0982@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Nambers/ssrJSON-benchmark
8
+ Project-URL: Issues, https://github.com/Nambers/ssrJSON-benchmark/issues
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: System :: Benchmark
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Operating System :: OS Independent
15
+ Requires-Python: >=3.9
5
16
  Description-Content-Type: text/markdown
6
17
  License-File: LICENSE
7
- Requires-Dist: ssrjson
8
- Requires-Dist: orjson
9
- Requires-Dist: matplotlib
10
- Provides-Extra: all
11
- Requires-Dist: svglib; extra == "all"
12
- Requires-Dist: reportlab; extra == "all"
13
- Requires-Dist: py-cpuinfo; extra == "all"
14
- Dynamic: description
15
- Dynamic: description-content-type
16
18
  Dynamic: license-file
17
- Dynamic: provides-extra
18
- Dynamic: requires-dist
19
- Dynamic: summary
20
19
 
21
20
  # ssrJSON-benchmark
22
21
 
22
+ <div align="center">
23
+
24
+ [![PyPI - Version](https://img.shields.io/pypi/v/ssrjson-benchmark)](https://pypi.org/project/ssrjson-benchmark/) [![PyPI - Wheel](https://img.shields.io/pypi/wheel/ssrjson-benchmark)](https://pypi.org/project/ssrjson-benchmark/)
25
+
23
26
  The [ssrJSON](https://github.com/Antares0982/ssrjson) benchmark repository.
24
27
 
28
+ </div>
29
+
25
30
  ## Benchmark Results
26
31
 
27
- The benchmark results can be found in [results](results). Contributing your benchmark result is welcomed.
32
+ The benchmark results can be found in [website results](https://ikuyo.dev/ssrJSON-benchmark/) or [GitHub results](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results). Contributing your benchmark result is welcomed.
28
33
 
29
34
  Quick jump for
30
35
 
31
- * [x86-64-v2, SSE4.2](results/SSE4.2)
32
- * [x86-64-v3, AVX2](results/AVX2)
33
- * [x86-64-v4, AVX512](results/AVX512)
36
+ * [x86-64-v2, SSE4.2](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/SSE4.2)
37
+ * [x86-64-v3, AVX2](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/AVX2)
38
+ * [x86-64-v4, AVX512](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/AVX512)
34
39
 
35
40
  ## Usage
36
41
 
37
- To generate a benchmark report, you need to install `ssrJSON` either by fetched [PyPi](https://pypi.org/project/ssrjson/) or built from [source](https://github.com/Antares0982/ssrjson), and toolkit(`ssrjson_benchmark`) from this repo by:
38
-
39
- ```bash
40
- python -m build
41
- pip install dist/*.whl
42
- ```
43
-
44
- Then run the benchmark script:
45
-
46
42
  ```bash
47
- python benchmark.py
43
+ # you may need to install `svglib`, `reportlab` and `py-cpuinfo` as well
44
+ pip install ssrjson-benchmark
45
+ python -m ssrjson_benchmark
48
46
  ```
49
47
 
50
48
  ## Benchmark options
@@ -56,9 +54,6 @@ python benchmark.py
56
54
  ## Notes
57
55
 
58
56
  * 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`.
59
- * 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.
60
- * 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 `PyUnicodeObject`s are different for each input every time.
61
-
57
+ * 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 `PyUnicodeObject`s are different for each input every time. (ref: [orjson#586](https://github.com/ijl/orjson/issues/586))
62
58
  * 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.
63
-
64
59
  * 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.
@@ -1,30 +1,29 @@
1
1
  # ssrJSON-benchmark
2
2
 
3
+ <div align="center">
4
+
5
+ [![PyPI - Version](https://img.shields.io/pypi/v/ssrjson-benchmark)](https://pypi.org/project/ssrjson-benchmark/) [![PyPI - Wheel](https://img.shields.io/pypi/wheel/ssrjson-benchmark)](https://pypi.org/project/ssrjson-benchmark/)
6
+
3
7
  The [ssrJSON](https://github.com/Antares0982/ssrjson) benchmark repository.
4
8
 
9
+ </div>
10
+
5
11
  ## Benchmark Results
6
12
 
7
- The benchmark results can be found in [results](results). Contributing your benchmark result is welcomed.
13
+ The benchmark results can be found in [website results](https://ikuyo.dev/ssrJSON-benchmark/) or [GitHub results](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results). Contributing your benchmark result is welcomed.
8
14
 
9
15
  Quick jump for
10
16
 
11
- * [x86-64-v2, SSE4.2](results/SSE4.2)
12
- * [x86-64-v3, AVX2](results/AVX2)
13
- * [x86-64-v4, AVX512](results/AVX512)
17
+ * [x86-64-v2, SSE4.2](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/SSE4.2)
18
+ * [x86-64-v3, AVX2](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/AVX2)
19
+ * [x86-64-v4, AVX512](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/AVX512)
14
20
 
15
21
  ## Usage
16
22
 
17
- To generate a benchmark report, you need to install `ssrJSON` either by fetched [PyPi](https://pypi.org/project/ssrjson/) or built from [source](https://github.com/Antares0982/ssrjson), and toolkit(`ssrjson_benchmark`) from this repo by:
18
-
19
- ```bash
20
- python -m build
21
- pip install dist/*.whl
22
- ```
23
-
24
- Then run the benchmark script:
25
-
26
23
  ```bash
27
- python benchmark.py
24
+ # you may need to install `svglib`, `reportlab` and `py-cpuinfo` as well
25
+ pip install ssrjson-benchmark
26
+ python -m ssrjson_benchmark
28
27
  ```
29
28
 
30
29
  ## Benchmark options
@@ -36,9 +35,6 @@ python benchmark.py
36
35
  ## Notes
37
36
 
38
37
  * 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`.
39
- * 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.
40
- * 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 `PyUnicodeObject`s are different for each input every time.
41
-
38
+ * 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 `PyUnicodeObject`s are different for each input every time. (ref: [orjson#586](https://github.com/ijl/orjson/issues/586))
42
39
  * 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.
43
-
44
40
  * 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.
@@ -0,0 +1,28 @@
1
+ [build-system]
2
+ requires = ["setuptools >= 77.0.3"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ssrjson-benchmark"
7
+ version = "0.0.1rc1"
8
+ authors = [
9
+ { name="Eritque Arcus", email="eritque-arcus@ikuyo.dev" },
10
+ { name = "Antares", email = "antares0982@gmail.com" }
11
+ ]
12
+ description = "benchmark of ssrJSON"
13
+ readme = "README.md"
14
+ requires-python = ">=3.9"
15
+ classifiers = [
16
+ "Development Status :: 5 - Production/Stable",
17
+ "Environment :: Console",
18
+ "Intended Audience :: Developers",
19
+ "Topic :: System :: Benchmark",
20
+ "Programming Language :: Python :: 3",
21
+ "Operating System :: OS Independent",
22
+ ]
23
+ license = "MIT"
24
+ license-files = ["LICENSE"]
25
+
26
+ [project.urls]
27
+ Homepage = "https://github.com/Nambers/ssrJSON-benchmark"
28
+ Issues = "https://github.com/Nambers/ssrJSON-benchmark/issues"
@@ -23,7 +23,7 @@
23
23
  #include <Python.h>
24
24
  #include <stdbool.h>
25
25
 
26
- #define SSRJSON_BENCHMARK_VERSION "0.0.1a0"
26
+ #define SSRJSON_BENCHMARK_VERSION "0.0.1rc1"
27
27
 
28
28
  /** compiler builtin check (since gcc 10.0, clang 2.6, icc 2021) */
29
29
  #ifndef has_builtin
@@ -4,10 +4,12 @@ from .benchmark_main import (
4
4
  generate_report,
5
5
  run_benchmark_default,
6
6
  )
7
+ from ._ssrjson_benchmark import __version__
7
8
 
8
9
  __all__ = [
9
10
  "run_benchmark",
10
11
  "generate_report_markdown",
11
12
  "generate_report",
12
13
  "run_benchmark_default",
14
+ "__version__",
13
15
  ]
@@ -263,7 +263,7 @@ def run_file_benchmark(
263
263
 
264
264
 
265
265
  def get_head_rev_name():
266
- return ssrjson.__version__
266
+ return getattr(ssrjson, "__version__", None) or getattr(ssrjson, "ssrjson").__version__
267
267
 
268
268
 
269
269
  def get_real_output_file_name():
@@ -1,50 +1,48 @@
1
1
  Metadata-Version: 2.4
2
- Name: ssrjson_benchmark
3
- Version: 0.0.1a0
4
- Summary: Benchmark for ssrJSON
2
+ Name: ssrjson-benchmark
3
+ Version: 0.0.1rc1
4
+ Summary: benchmark of ssrJSON
5
+ Author-email: Eritque Arcus <eritque-arcus@ikuyo.dev>, Antares <antares0982@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Nambers/ssrJSON-benchmark
8
+ Project-URL: Issues, https://github.com/Nambers/ssrJSON-benchmark/issues
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: System :: Benchmark
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Operating System :: OS Independent
15
+ Requires-Python: >=3.9
5
16
  Description-Content-Type: text/markdown
6
17
  License-File: LICENSE
7
- Requires-Dist: ssrjson
8
- Requires-Dist: orjson
9
- Requires-Dist: matplotlib
10
- Provides-Extra: all
11
- Requires-Dist: svglib; extra == "all"
12
- Requires-Dist: reportlab; extra == "all"
13
- Requires-Dist: py-cpuinfo; extra == "all"
14
- Dynamic: description
15
- Dynamic: description-content-type
16
18
  Dynamic: license-file
17
- Dynamic: provides-extra
18
- Dynamic: requires-dist
19
- Dynamic: summary
20
19
 
21
20
  # ssrJSON-benchmark
22
21
 
22
+ <div align="center">
23
+
24
+ [![PyPI - Version](https://img.shields.io/pypi/v/ssrjson-benchmark)](https://pypi.org/project/ssrjson-benchmark/) [![PyPI - Wheel](https://img.shields.io/pypi/wheel/ssrjson-benchmark)](https://pypi.org/project/ssrjson-benchmark/)
25
+
23
26
  The [ssrJSON](https://github.com/Antares0982/ssrjson) benchmark repository.
24
27
 
28
+ </div>
29
+
25
30
  ## Benchmark Results
26
31
 
27
- The benchmark results can be found in [results](results). Contributing your benchmark result is welcomed.
32
+ The benchmark results can be found in [website results](https://ikuyo.dev/ssrJSON-benchmark/) or [GitHub results](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results). Contributing your benchmark result is welcomed.
28
33
 
29
34
  Quick jump for
30
35
 
31
- * [x86-64-v2, SSE4.2](results/SSE4.2)
32
- * [x86-64-v3, AVX2](results/AVX2)
33
- * [x86-64-v4, AVX512](results/AVX512)
36
+ * [x86-64-v2, SSE4.2](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/SSE4.2)
37
+ * [x86-64-v3, AVX2](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/AVX2)
38
+ * [x86-64-v4, AVX512](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/AVX512)
34
39
 
35
40
  ## Usage
36
41
 
37
- To generate a benchmark report, you need to install `ssrJSON` either by fetched [PyPi](https://pypi.org/project/ssrjson/) or built from [source](https://github.com/Antares0982/ssrjson), and toolkit(`ssrjson_benchmark`) from this repo by:
38
-
39
- ```bash
40
- python -m build
41
- pip install dist/*.whl
42
- ```
43
-
44
- Then run the benchmark script:
45
-
46
42
  ```bash
47
- python benchmark.py
43
+ # you may need to install `svglib`, `reportlab` and `py-cpuinfo` as well
44
+ pip install ssrjson-benchmark
45
+ python -m ssrjson_benchmark
48
46
  ```
49
47
 
50
48
  ## Benchmark options
@@ -56,9 +54,6 @@ python benchmark.py
56
54
  ## Notes
57
55
 
58
56
  * 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`.
59
- * 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.
60
- * 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 `PyUnicodeObject`s are different for each input every time.
61
-
57
+ * 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 `PyUnicodeObject`s are different for each input every time. (ref: [orjson#586](https://github.com/ijl/orjson/issues/586))
62
58
  * 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.
63
-
64
59
  * 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.
@@ -2,6 +2,7 @@ CMakeLists.txt
2
2
  LICENSE
3
3
  MANIFEST.in
4
4
  README.md
5
+ pyproject.toml
5
6
  setup.py
6
7
  cmake/XcodeProperty.cmake
7
8
  src/benchmark.c
@@ -12,7 +13,6 @@ src/ssrjson_benchmark/template.md
12
13
  src/ssrjson_benchmark.egg-info/PKG-INFO
13
14
  src/ssrjson_benchmark.egg-info/SOURCES.txt
14
15
  src/ssrjson_benchmark.egg-info/dependency_links.txt
15
- src/ssrjson_benchmark.egg-info/requires.txt
16
16
  src/ssrjson_benchmark.egg-info/top_level.txt
17
17
  src/ssrjson_benchmark/_files/MotionsQuestionsAnswersQuestions2016.json
18
18
  src/ssrjson_benchmark/_files/apache.json
@@ -1,8 +0,0 @@
1
- ssrjson
2
- orjson
3
- matplotlib
4
-
5
- [all]
6
- svglib
7
- reportlab
8
- py-cpuinfo