-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-benchmarks.py
37 lines (26 loc) · 1.02 KB
/
run-benchmarks.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
import subprocess
import os
import timeit
import json
if __name__ == "__main__":
start_time = timeit.default_timer()
find_zokka_cmd = ["cabal", "list-bin", "zokka"]
benchmarks_location = "./runtime-benchmarks/core/"
zokka_exec_location = \
subprocess.run(find_zokka_cmd, capture_output=True).stdout.strip()
print(f"=========\nRunning Benchmarks\n=========\n")
benchmark_compilation_output = \
subprocess.run(
[zokka_exec_location, "make", "V8/Benchmark.elm", "--optimize", "--output", "elm.js"],
capture_output=True,
cwd=benchmarks_location,
).stdout.strip()
benchmark_output = \
subprocess.run(
["node", "runner.js"],
capture_output=True,
cwd=benchmarks_location,
).stdout.strip()
print(json.loads(benchmark_output))
total_benchmark_duration = timeit.default_timer() - start_time
print(f"=========\nTotal benchmark duration: {total_benchmark_duration} seconds\n=========\n")