-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgenerate_page.py
53 lines (41 loc) · 1.23 KB
/
generate_page.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/python3
import subprocess,sys,platform
tmpl_md="""# Results from '%s' host
The goal is to compare runtime speed of a same algo (sudoku resolver), in differents implementations/languages, while injecting the 1956 grids of [grids.txt](grids.txt)
## Regular Results
All implementations use same bases types (string)
```
%s
```
## Specialized Results
It's the same algorithm, but use specialized weapons (types/apis) from the languages, to be as faster as possible.
```
%s
```
## Context
Here are informations about the host/computer, and languages/versions/cmdline used for tests:
```
%s
```
"""
def call_make(*args):
cmd=[sys.executable, "make.py", *args]
cp=subprocess.run(cmd,shell=False,text=True,capture_output=True)
return cp.stdout
if __name__=="__main__":
if sys.argv[1:]==["RESULTS"]:
# STATS from RESULTS.TXT
print( tmpl_md % (
"GITHUB",
call_make("RESULTS","."),
call_make("RESULTS","specialized"),
call_make("info"),
))
else:
# STATS from live db
print( tmpl_md % (
platform.node(),
call_make("stats","."),
call_make("stats","specialized"),
call_make("info"),
))