Skip to content

Commit 182a83a

Browse files
committed
select a subset of numpy and pyperformance benchmarks by default to reduce benchmark runtime
1 parent 894b0fe commit 182a83a

File tree

1 file changed

+66
-3
lines changed

1 file changed

+66
-3
lines changed

mx.graalpython/mx_graalpython_python_benchmarks.py

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,66 @@
5454
SUITE = None
5555
python_vm_registry = None
5656

57+
DEFAULT_NUMPY_BENCHMARKS = [
58+
"bench_app",
59+
"bench_core",
60+
# "bench_function_base",
61+
"bench_indexing",
62+
# "bench_io",
63+
"bench_linalg",
64+
# "bench_ma",
65+
# "bench_random",
66+
"bench_reduce",
67+
# "bench_shape_base",
68+
# "bench_ufunc",
69+
]
70+
71+
DEFAULT_PYPERFORMANCE_BENCHMARKS = [
72+
# "2to3",
73+
# "chameleon",
74+
"chaos",
75+
# "crypto_pyaes",
76+
# "django_template",
77+
# "dulwich_log",
78+
"fannkuch",
79+
"float",
80+
"go",
81+
"hexiom",
82+
# "html5lib",
83+
"json_dumps",
84+
"json_loads",
85+
"logging",
86+
# "mako",
87+
"meteor_contest",
88+
"nbody",
89+
"nqueens",
90+
"pathlib",
91+
"pickle",
92+
"pickle_dict",
93+
"pickle_list",
94+
"pickle_pure_python",
95+
"pidigits",
96+
"pyflate",
97+
"regex_compile",
98+
"regex_dna",
99+
"regex_effbot",
100+
"regex_v8",
101+
"richards",
102+
"scimark",
103+
"spectral_norm",
104+
# "sqlalchemy_declarative",
105+
# "sqlalchemy_imperative",
106+
# "sqlite_synth",
107+
"sympy",
108+
"telco",
109+
"tornado_http",
110+
"unpack_sequence",
111+
"unpickle",
112+
"unpickle_list",
113+
"unpickle_pure_python",
114+
"xml_etree",
115+
]
116+
57117

58118
class PyPerfJsonRule(mx_benchmark.Rule):
59119
"""Parses a JSON file produced by PyPerf and creates a measurement result."""
@@ -343,7 +403,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
343403
if benchmarks:
344404
bms = ["-b", ",".join(benchmarks)]
345405
else:
346-
bms = []
406+
bms = ["-b", ",".join(DEFAULT_PYPERFORMANCE_BENCHMARKS)]
347407
retcode = mx.run(
348408
[
349409
join(vm_venv, "bin", "pyperformance"),
@@ -414,7 +474,9 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
414474

415475
with open(join(workdir, "benchmarks", "benchmarks.py")) as f:
416476
content = f.read()
417-
content = content.replace('float(line.split(b" ")[0])', 'float(line.split()[0])')
477+
content = content.replace(
478+
'float(line.split(b" ")[0])', "float(line.split()[0])"
479+
)
418480
with open(join(workdir, "benchmarks", "benchmarks.py"), "w") as f:
419481
f.write(content)
420482

@@ -520,7 +582,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
520582
if benchmarks:
521583
bms = ["-b", "|".join(benchmarks)]
522584
else:
523-
bms = []
585+
bms = ["-b", "|".join(DEFAULT_NUMPY_BENCHMARKS)]
524586
retcode = mx.run(
525587
[
526588
join(workdir, vm_venv, "bin", "asv"),
@@ -550,6 +612,7 @@ def register_python_benchmarks():
550612
global python_vm_registry, SUITE
551613

552614
from mx_graalpython_benchmark import python_vm_registry as vm_registry
615+
553616
python_vm_registry = vm_registry
554617

555618
SUITE = mx.suite("graalpython")

0 commit comments

Comments
 (0)