ssrjson-benchmark 0.0.1__cp39-cp39-win_amd64.whl → 0.0.1b0__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.
- ssrjson_benchmark/__init__.py +15 -0
- ssrjson_benchmark/__main__.py +54 -0
- ssrjson_benchmark/_files/MotionsQuestionsAnswersQuestions2016.json +1 -0
- ssrjson_benchmark/_files/apache.json +3532 -0
- ssrjson_benchmark/_files/canada.json +56532 -0
- ssrjson_benchmark/_files/ctm.json +48951 -0
- ssrjson_benchmark/_files/github.json +1320 -0
- ssrjson_benchmark/_files/instruments.json +7395 -0
- ssrjson_benchmark/_files/mesh.json +3602 -0
- ssrjson_benchmark/_files/simple_object.json +11 -0
- ssrjson_benchmark/_files/simple_object_zh.json +11 -0
- ssrjson_benchmark/_files/truenull.json +1 -0
- ssrjson_benchmark/_files/tweet.json +135 -0
- ssrjson_benchmark/_files/twitter.json +15195 -0
- ssrjson_benchmark.pyd → ssrjson_benchmark/_ssrjson_benchmark.pyd +0 -0
- ssrjson_benchmark/benchmark_main.py +652 -0
- ssrjson_benchmark/template.md +10 -0
- ssrjson_benchmark-0.0.1b0.dist-info/METADATA +60 -0
- ssrjson_benchmark-0.0.1b0.dist-info/RECORD +22 -0
- ssrjson_benchmark-0.0.1b0.dist-info/top_level.txt +2 -0
- ssrjson_benchmark-0.0.1.dist-info/METADATA +0 -5
- ssrjson_benchmark-0.0.1.dist-info/RECORD +0 -6
- ssrjson_benchmark-0.0.1.dist-info/top_level.txt +0 -1
- {ssrjson_benchmark-0.0.1.dist-info → ssrjson_benchmark-0.0.1b0.dist-info}/WHEEL +0 -0
- {ssrjson_benchmark-0.0.1.dist-info → ssrjson_benchmark-0.0.1b0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from .benchmark_main import (
|
|
2
|
+
run_benchmark,
|
|
3
|
+
generate_report_markdown,
|
|
4
|
+
generate_report,
|
|
5
|
+
run_benchmark_default,
|
|
6
|
+
)
|
|
7
|
+
from ._ssrjson_benchmark import __version__
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"run_benchmark",
|
|
11
|
+
"generate_report_markdown",
|
|
12
|
+
"generate_report",
|
|
13
|
+
"run_benchmark_default",
|
|
14
|
+
"__version__",
|
|
15
|
+
]
|
|
@@ -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()
|