ssrjson-benchmark 0.0.1b0__tar.gz → 0.0.1rc2__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.1b0/src/ssrjson_benchmark.egg-info → ssrjson_benchmark-0.0.1rc2}/PKG-INFO +25 -16
  2. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/README.md +4 -4
  3. ssrjson_benchmark-0.0.1rc2/pyproject.toml +35 -0
  4. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/setup.py +1 -21
  5. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/benchmark.c +0 -11
  6. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/__init__.py +3 -1
  7. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/benchmark_main.py +18 -2
  8. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2/src/ssrjson_benchmark.egg-info}/PKG-INFO +25 -16
  9. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark.egg-info/SOURCES.txt +1 -0
  10. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark.egg-info/requires.txt +4 -2
  11. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/CMakeLists.txt +0 -0
  12. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/LICENSE +0 -0
  13. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/MANIFEST.in +0 -0
  14. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/cmake/XcodeProperty.cmake +0 -0
  15. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/setup.cfg +0 -0
  16. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/__main__.py +0 -0
  17. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/MotionsQuestionsAnswersQuestions2016.json +0 -0
  18. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/apache.json +0 -0
  19. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/canada.json +0 -0
  20. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/ctm.json +0 -0
  21. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/github.json +0 -0
  22. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/instruments.json +0 -0
  23. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/mesh.json +0 -0
  24. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/simple_object.json +0 -0
  25. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/simple_object_zh.json +0 -0
  26. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/truenull.json +0 -0
  27. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/tweet.json +0 -0
  28. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/_files/twitter.json +0 -0
  29. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark/template.md +0 -0
  30. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark.egg-info/dependency_links.txt +0 -0
  31. {ssrjson_benchmark-0.0.1b0 → ssrjson_benchmark-0.0.1rc2}/src/ssrjson_benchmark.egg-info/top_level.txt +0 -0
@@ -1,22 +1,31 @@
1
1
  Metadata-Version: 2.4
2
- Name: ssrjson_benchmark
3
- Version: 0.0.1b0
4
- Summary: Benchmark for ssrJSON
2
+ Name: ssrjson-benchmark
3
+ Version: 0.0.1rc2
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
+ Project-URL: Repository, https://github.com/Nambers/ssrJSON-benchmark.git
10
+ Keywords: ssrjson,benchmark,json
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: System :: Benchmark
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Operating System :: OS Independent
17
+ Requires-Python: >=3.9
5
18
  Description-Content-Type: text/markdown
6
19
  License-File: LICENSE
7
20
  Requires-Dist: ssrjson
8
21
  Requires-Dist: orjson
9
22
  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
23
+ Provides-Extra: pdf
24
+ Requires-Dist: svglib; extra == "pdf"
25
+ Requires-Dist: reportlab; extra == "pdf"
26
+ Provides-Extra: cpuinfo
27
+ Requires-Dist: py-cpuinfo; extra == "cpuinfo"
16
28
  Dynamic: license-file
17
- Dynamic: provides-extra
18
- Dynamic: requires-dist
19
- Dynamic: summary
20
29
 
21
30
  # ssrJSON-benchmark
22
31
 
@@ -30,13 +39,13 @@ The [ssrJSON](https://github.com/Antares0982/ssrjson) benchmark repository.
30
39
 
31
40
  ## Benchmark Results
32
41
 
33
- The benchmark results can be found in [results](results). Contributing your benchmark result is welcomed.
42
+ 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.
34
43
 
35
44
  Quick jump for
36
45
 
37
- * [x86-64-v2, SSE4.2](results/SSE4.2)
38
- * [x86-64-v3, AVX2](results/AVX2)
39
- * [x86-64-v4, AVX512](results/AVX512)
46
+ * [x86-64-v2, SSE4.2](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/SSE4.2)
47
+ * [x86-64-v3, AVX2](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/AVX2)
48
+ * [x86-64-v4, AVX512](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/AVX512)
40
49
 
41
50
  ## Usage
42
51
 
@@ -10,13 +10,13 @@ The [ssrJSON](https://github.com/Antares0982/ssrjson) benchmark repository.
10
10
 
11
11
  ## Benchmark Results
12
12
 
13
- 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.
14
14
 
15
15
  Quick jump for
16
16
 
17
- * [x86-64-v2, SSE4.2](results/SSE4.2)
18
- * [x86-64-v3, AVX2](results/AVX2)
19
- * [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)
20
20
 
21
21
  ## Usage
22
22
 
@@ -0,0 +1,35 @@
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.1rc2"
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
+ keywords = ["ssrjson", "benchmark", "json"]
16
+ classifiers = [
17
+ "Development Status :: 5 - Production/Stable",
18
+ "Environment :: Console",
19
+ "Intended Audience :: Developers",
20
+ "Topic :: System :: Benchmark",
21
+ "Programming Language :: Python :: 3",
22
+ "Operating System :: OS Independent",
23
+ ]
24
+ license = "MIT"
25
+ license-files = ["LICENSE"]
26
+ dependencies = ["ssrjson", "orjson", "matplotlib"]
27
+
28
+ [project.optional-dependencies]
29
+ pdf = ["svglib", "reportlab"]
30
+ cpuinfo = ["py-cpuinfo"]
31
+
32
+ [project.urls]
33
+ Homepage = "https://github.com/Nambers/ssrJSON-benchmark"
34
+ Issues = "https://github.com/Nambers/ssrJSON-benchmark/issues"
35
+ Repository = "https://github.com/Nambers/ssrJSON-benchmark.git"
@@ -2,23 +2,8 @@ import os
2
2
  import shutil
3
3
  import subprocess
4
4
 
5
- from setuptools import Extension, find_packages, setup
5
+ from setuptools import Extension, setup
6
6
  from setuptools.command.build_ext import build_ext
7
- from pathlib import Path
8
-
9
-
10
- def find_version(src_file_content: str):
11
- # find macro SSRJSON_BENCHMARK_VERSION
12
- prefix = "#define SSRJSON_BENCHMARK_VERSION"
13
- for line in src_file_content.splitlines():
14
- if line.startswith(prefix):
15
- version = line[len(prefix) :].strip()[1:-1]
16
- return version
17
- raise RuntimeError("Cannot find SSRJSON_BENCHMARK_VERSION in source file")
18
-
19
-
20
- with open("./src/benchmark.c", "r", encoding="utf-8") as f:
21
- version_string = find_version(f.read())
22
7
 
23
8
 
24
9
  class CMakeBuild(build_ext):
@@ -63,11 +48,6 @@ class CMakeBuild(build_ext):
63
48
 
64
49
 
65
50
  setup(
66
- name="ssrjson_benchmark",
67
- version=version_string,
68
- description="Benchmark for ssrJSON",
69
- long_description=Path("README.md").read_text(encoding="utf-8"),
70
- long_description_content_type="text/markdown",
71
51
  ext_modules=[
72
52
  Extension(
73
53
  "_ssrjson_benchmark",
@@ -23,8 +23,6 @@
23
23
  #include <Python.h>
24
24
  #include <stdbool.h>
25
25
 
26
- #define SSRJSON_BENCHMARK_VERSION "0.0.1b0"
27
-
28
26
  /** compiler builtin check (since gcc 10.0, clang 2.6, icc 2021) */
29
27
  #ifndef has_builtin
30
28
  # ifdef __has_builtin
@@ -341,14 +339,5 @@ PyMODINIT_FUNC PyInit__ssrjson_benchmark(void) {
341
339
  if (module == NULL) {
342
340
  return NULL;
343
341
  }
344
- // add version string
345
- {
346
- int err = PyModule_AddStringConstant(module, "__version__", SSRJSON_BENCHMARK_VERSION);
347
- if (err) {
348
- Py_DECREF(module);
349
- return NULL;
350
- }
351
- }
352
-
353
342
  return module;
354
343
  }
@@ -4,7 +4,9 @@ from .benchmark_main import (
4
4
  generate_report,
5
5
  run_benchmark_default,
6
6
  )
7
- from ._ssrjson_benchmark import __version__
7
+ from importlib.metadata import version
8
+
9
+ __version__ = version("ssrjson-benchmark")
8
10
 
9
11
  __all__ = [
10
12
  "run_benchmark",
@@ -230,9 +230,10 @@ def _run_benchmark(
230
230
  if isinstance(input_data, bytes)
231
231
  else _ssrjson_benchmark.inspect_pyunicode(input_data)[1]
232
232
  )
233
- cur_obj["ssrjson_bytes_per_sec"] = ssrjson.dumps(
233
+ cur_obj["ssrjson_bytes_per_sec"] = (
234
234
  size * repeat_times / (cur_obj[name]["speed"] / _NS_IN_ONE_S)
235
235
  )
236
+
236
237
  for index in INDEXES:
237
238
  basename = name.split(".")[0]
238
239
  if baseline_data[index] == 0:
@@ -263,7 +264,9 @@ def run_file_benchmark(
263
264
 
264
265
 
265
266
  def get_head_rev_name():
266
- return getattr(ssrjson, "__version__", ssrjson.ssrjson.__version__)
267
+ return (
268
+ getattr(ssrjson, "__version__", None) or getattr(ssrjson, "ssrjson").__version__
269
+ )
267
270
 
268
271
 
269
272
  def get_real_output_file_name():
@@ -354,6 +357,7 @@ def plot_relative_ops(data: dict, doc_name: str, index_s: str) -> io.BytesIO:
354
357
 
355
358
  for ax, cat in zip(axs, CATEGORIES):
356
359
  vals = [1.0] + [data[cat][f"{name}_{index_s}_ratio"] for name in libs[1:]]
360
+ gbps = (data[cat]["ssrjson_bytes_per_sec"] * 8) / (1024**3)
357
361
 
358
362
  for xi, val, col in zip(x_positions, vals, colors):
359
363
  ax.bar(xi, val, width=bar_width, color=col)
@@ -367,6 +371,18 @@ def plot_relative_ops(data: dict, doc_name: str, index_s: str) -> io.BytesIO:
367
371
  color=get_ratio_color(val),
368
372
  )
369
373
 
374
+ ssrjson_index = libs.index("ssrjson")
375
+ ax.text(
376
+ x_positions[ssrjson_index],
377
+ vals[ssrjson_index] / 2,
378
+ f"{gbps:.2f} Gb/s",
379
+ ha="center",
380
+ va="center",
381
+ fontsize=10,
382
+ color="#2c3e50",
383
+ fontweight="bold",
384
+ )
385
+
370
386
  # baseline line
371
387
  ax.axhline(1.0, color="gray", linestyle="--", linewidth=1)
372
388
  # height = 1.1 * max bar height
@@ -1,22 +1,31 @@
1
1
  Metadata-Version: 2.4
2
- Name: ssrjson_benchmark
3
- Version: 0.0.1b0
4
- Summary: Benchmark for ssrJSON
2
+ Name: ssrjson-benchmark
3
+ Version: 0.0.1rc2
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
+ Project-URL: Repository, https://github.com/Nambers/ssrJSON-benchmark.git
10
+ Keywords: ssrjson,benchmark,json
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: System :: Benchmark
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Operating System :: OS Independent
17
+ Requires-Python: >=3.9
5
18
  Description-Content-Type: text/markdown
6
19
  License-File: LICENSE
7
20
  Requires-Dist: ssrjson
8
21
  Requires-Dist: orjson
9
22
  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
23
+ Provides-Extra: pdf
24
+ Requires-Dist: svglib; extra == "pdf"
25
+ Requires-Dist: reportlab; extra == "pdf"
26
+ Provides-Extra: cpuinfo
27
+ Requires-Dist: py-cpuinfo; extra == "cpuinfo"
16
28
  Dynamic: license-file
17
- Dynamic: provides-extra
18
- Dynamic: requires-dist
19
- Dynamic: summary
20
29
 
21
30
  # ssrJSON-benchmark
22
31
 
@@ -30,13 +39,13 @@ The [ssrJSON](https://github.com/Antares0982/ssrjson) benchmark repository.
30
39
 
31
40
  ## Benchmark Results
32
41
 
33
- The benchmark results can be found in [results](results). Contributing your benchmark result is welcomed.
42
+ 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.
34
43
 
35
44
  Quick jump for
36
45
 
37
- * [x86-64-v2, SSE4.2](results/SSE4.2)
38
- * [x86-64-v3, AVX2](results/AVX2)
39
- * [x86-64-v4, AVX512](results/AVX512)
46
+ * [x86-64-v2, SSE4.2](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/SSE4.2)
47
+ * [x86-64-v3, AVX2](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/AVX2)
48
+ * [x86-64-v4, AVX512](https://github.com/Nambers/ssrJSON-benchmark/tree/main/results/AVX512)
40
49
 
41
50
  ## Usage
42
51
 
@@ -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
@@ -2,7 +2,9 @@ ssrjson
2
2
  orjson
3
3
  matplotlib
4
4
 
5
- [all]
5
+ [cpuinfo]
6
+ py-cpuinfo
7
+
8
+ [pdf]
6
9
  svglib
7
10
  reportlab
8
- py-cpuinfo