mirror of https://github.com/pyodide/pyodide.git
Fix benchmark plot. Don't include Numpy import in benchmark timing.
This commit is contained in:
parent
0aeec6702c
commit
35a684271b
2
Makefile
2
Makefile
|
@ -65,7 +65,7 @@ test: all build/test.html
|
|||
|
||||
benchmark: all build/test.html
|
||||
python benchmark/benchmark.py $(HOSTPYTHON) build/benchmarks.json
|
||||
python benchmark/plot_benchmark.py benchmarks.json build/benchmarks.png
|
||||
python benchmark/plot_benchmark.py build/benchmarks.json build/benchmarks.png
|
||||
|
||||
|
||||
clean:
|
||||
|
|
|
@ -70,11 +70,12 @@ def get_numpy_benchmarks():
|
|||
continue
|
||||
content = parse_numpy_benchmark(os.path.join(root, filename))
|
||||
content += (
|
||||
"import numpy as np\n"
|
||||
"_ = np.empty(())\n"
|
||||
"setup = setup + '\\nfrom __main__ import {}'\n"
|
||||
"from timeit import Timer\n"
|
||||
"t = Timer(run, setup)\n"
|
||||
"r = t.repeat(11, 40)\n"
|
||||
"import numpy as np\n"
|
||||
"print(np.mean(r))\n".format(name))
|
||||
yield name, content
|
||||
|
||||
|
|
Loading…
Reference in New Issue