ssrjson-benchmark 0.0.1__cp39-cp39-win_amd64.whl → 0.0.1a0__cp39-cp39-win_amd64.whl

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.

@@ -0,0 +1,13 @@
1
+ from .benchmark_main import (
2
+ run_benchmark,
3
+ generate_report_markdown,
4
+ generate_report,
5
+ run_benchmark_default,
6
+ )
7
+
8
+ __all__ = [
9
+ "run_benchmark",
10
+ "generate_report_markdown",
11
+ "generate_report",
12
+ "run_benchmark_default",
13
+ ]
@@ -0,0 +1,54 @@
1
+ import argparse
2
+ import json
3
+ import os
4
+ from ssrjson_benchmark import (
5
+ run_benchmark,
6
+ generate_report_markdown,
7
+ generate_report,
8
+ )
9
+
10
+
11
+ def main():
12
+ parser = argparse.ArgumentParser()
13
+
14
+ parser.add_argument(
15
+ "-f", "--file", help="record JSON file", required=False, default=None
16
+ )
17
+ parser.add_argument(
18
+ "-m",
19
+ "--markdown",
20
+ help="Generate markdown report",
21
+ required=False,
22
+ action="store_true",
23
+ )
24
+ parser.add_argument(
25
+ "--process-bytes",
26
+ help="Total process bytes per test, default 1e8",
27
+ required=False,
28
+ default=1e8,
29
+ type=int,
30
+ )
31
+ parser.add_argument(
32
+ "--out-dir",
33
+ help="Output directory for reports",
34
+ required=False,
35
+ default=os.getcwd(),
36
+ )
37
+ args = parser.parse_args()
38
+
39
+ if args.file:
40
+ with open(args.file, "r") as f:
41
+ j = json.load(f)
42
+ file = args.file.split("/")[-1]
43
+ else:
44
+ j, file = run_benchmark(args.process_bytes)
45
+ file = file.split("/")[-1]
46
+
47
+ if args.markdown:
48
+ generate_report_markdown(j, file, args.out_dir)
49
+ else:
50
+ generate_report(j, file, args.out_dir)
51
+
52
+
53
+ if __name__ == "__main__":
54
+ main()