Skip to content

Commit f1a9e6e

Browse files
committed
[GR-12531] fix micros
PullRequest: graalpython/276
2 parents d2d7576 + 7a006c9 commit f1a9e6e

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
overlay: "2b63e24614bc48b008ea15460ab22129f4a2c442",
2+
overlay: "7d52b9cf9133fbfadcff23cd368aacc7a6a362d5",
33

44
// ======================================================================================================
55
//

mx.graalpython/mx_graalpython_bench_param.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,21 @@
9292
'special-add': ITER_15 + ['5'],
9393
'special-len': ITER_10 + ['5'],
9494
'member_access': ITER_10 + ['5'],
95+
'magic-bool': ITER_10 + ['100000000'],
96+
'magic-iter': ITER_10 + ['50000000'],
97+
'instantiation': ITER_10 + ['50000000'],
98+
'call-classmethod': ITER_15 + ['50000000'],
99+
}
100+
101+
102+
MICRO_NATIVE_BENCHMARKS = {
95103
'c_member_access': ITER_25 + ['5'],
96104
'c-list-iterating-obj': ITER_15 + ['50000000'],
97-
'magic-bool': ITER_10 + ['100000000'],
98105
'c-magic-bool': ITER_10 + ['100000000'],
99-
'magic-iter': ITER_10 + ['50000000'],
100106
'c-magic-iter': ITER_10 + ['50000000'],
101-
'instantiation': ITER_10 + ['50000000'],
102107
'c-instantiation': ITER_10 + ['50000000'],
103108
'c_arith-binop': ITER_25 + ['5'],
104109
'c_arith_binop_2': ITER_25 + ['50'],
105-
'call-classmethod': ITER_15 + ['50000000'],
106110
'c-call-classmethod': ITER_15 + ['50000000']
107111
}
108112

@@ -159,6 +163,7 @@
159163
# ----------------------------------------------------------------------------------------------------------------------
160164
BENCHMARKS = {
161165
"micro": [PATH_MICRO, MICRO_BENCHMARKS],
166+
"micro-native": [PATH_MICRO, MICRO_NATIVE_BENCHMARKS],
162167
"meso": [PATH_MESO, MESO_BENCHMARKS],
163168
"macro": [PATH_MACRO, MACRO_BENCHMARKS],
164169
# "interop": [PATH_INTEROP, INTEROP_BENCHMARKS],

mx.graalpython/mx_graalpython_benchmark.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@ def run(self, cwd, args):
125125
class CPythonVm(AbstractPythonVm):
126126
PYTHON_INTERPRETER = "python3"
127127

128-
def __init__(self, config_name, options=None, virtualenv=None):
128+
def __init__(self, config_name, options=None, virtualenv=None, no_warmup=False):
129129
super(CPythonVm, self).__init__(config_name, options)
130130
self._virtualenv = virtualenv
131+
self._no_warmup = no_warmup
131132

132133
@property
133134
def interpreter(self):
@@ -138,6 +139,24 @@ def interpreter(self):
138139
def name(self):
139140
return VM_NAME_CPYTHON
140141

142+
@staticmethod
143+
def remove_warmup_runs(args):
144+
_args = []
145+
i = 0
146+
while i < len(args):
147+
arg = args[i]
148+
_args.append(arg)
149+
if arg == '-i':
150+
_args.append('0')
151+
i += 1
152+
i += 1
153+
return _args
154+
155+
def run(self, cwd, args):
156+
if self._no_warmup:
157+
args = CPythonVm.remove_warmup_runs(args)
158+
return super(CPythonVm, self).run(cwd, args)
159+
141160

142161
class PyPyVm(AbstractPythonVm):
143162
def __init__(self, config_name, options=None):
@@ -321,7 +340,8 @@ def successPatterns(self):
321340

322341
def failurePatterns(self):
323342
return [
324-
re.compile(r"Exception")
343+
# lookahead pattern for when truffle compilation details are enabled in the log
344+
re.compile(r"^(?!(\[truffle\])).*Exception")
325345
]
326346

327347
def group(self):

0 commit comments

Comments
 (0)