|
50 | 50 |
|
51 | 51 | LLVM_FEATURE_FLAGS = ['-mnontrapping-fptoint']
|
52 | 52 |
|
| 53 | +# A comma separated list of benchmarkers to run during test_benchmark tests. See |
| 54 | +# `named_benchmarkers` for what is available. |
| 55 | +EMTEST_BENCHMARKERS = os.getenv('EMTEST_BENCHMARKERS', 'clang,v8,v8-lto,v8-ctors') |
| 56 | + |
53 | 57 |
|
54 | 58 | class Benchmarker():
|
55 | 59 | # called when we init the object, which is during startup, even if we are
|
@@ -305,52 +309,30 @@ def get_output_files(self):
|
305 | 309 |
|
306 | 310 | benchmarkers: List[Benchmarker] = []
|
307 | 311 |
|
308 |
| -if not common.EMTEST_FORCE64: |
309 |
| - benchmarkers += [ |
310 |
| - NativeBenchmarker('clang', [CLANG_CC], [CLANG_CXX]), |
311 |
| - # NativeBenchmarker('gcc', ['gcc', '-no-pie'], ['g++', '-no-pie']) |
312 |
| - ] |
313 |
| - |
314 |
| -if config.V8_ENGINE and config.V8_ENGINE in config.JS_ENGINES: |
315 |
| - # avoid the baseline compiler running, because it adds a lot of noise |
316 |
| - # (the nondeterministic time it takes to get to the full compiler ends up |
317 |
| - # mattering as much as the actual benchmark) |
318 |
| - aot_v8 = config.V8_ENGINE + ['--no-liftoff'] |
319 |
| - default_v8_name = os.environ.get('EMBENCH_NAME') or 'v8' |
320 |
| - if common.EMTEST_FORCE64: |
321 |
| - benchmarkers += [ |
322 |
| - EmscriptenBenchmarker(default_v8_name, aot_v8, ['-sMEMORY64=2']), |
323 |
| - ] |
324 |
| - else: |
325 |
| - benchmarkers += [ |
326 |
| - EmscriptenBenchmarker(default_v8_name, aot_v8), |
327 |
| - EmscriptenBenchmarker(default_v8_name + '-lto', aot_v8, ['-flto']), |
328 |
| - EmscriptenBenchmarker(default_v8_name + '-ctors', aot_v8, ['-sEVAL_CTORS']), |
329 |
| - ] |
330 |
| - if os.path.exists(CHEERP_BIN): |
331 |
| - benchmarkers += [ |
332 |
| - # CheerpBenchmarker('cheerp-v8-wasm', aot_v8), |
333 |
| - ] |
334 |
| - |
335 |
| -if config.SPIDERMONKEY_ENGINE and config.SPIDERMONKEY_ENGINE in config.JS_ENGINES: |
| 312 | +# avoid the baseline compiler running, because it adds a lot of noise |
| 313 | +# (the nondeterministic time it takes to get to the full compiler ends up |
| 314 | +# mattering as much as the actual benchmark) |
| 315 | +aot_v8 = (config.V8_ENGINE if config.V8_ENGINE else []) + ['--no-liftoff'] |
| 316 | + |
| 317 | +named_benchmarkers = { |
| 318 | + 'clang': NativeBenchmarker('clang', [CLANG_CC], [CLANG_CXX]), |
| 319 | + 'gcc': NativeBenchmarker('gcc', ['gcc', '-no-pie'], ['g++', '-no-pie']), |
| 320 | + 'v8': EmscriptenBenchmarker('v8', aot_v8), |
| 321 | + 'v8-lto': EmscriptenBenchmarker('v8-lto', aot_v8, ['-flto']), |
| 322 | + 'v8-ctors': EmscriptenBenchmarker('v8-ctors', aot_v8, ['-sEVAL_CTORS']), |
| 323 | + 'v8-64': EmscriptenBenchmarker('v8-64', aot_v8, ['-sMEMORY64=2']), |
| 324 | + 'node': EmscriptenBenchmarker('node', config.NODE_JS), |
| 325 | + 'node-64': EmscriptenBenchmarker('node-64', config.NODE_JS, ['-sMEMORY64=2']), |
| 326 | + 'cherp-v8': CheerpBenchmarker('cheerp-v8-wasm', aot_v8), |
336 | 327 | # TODO: ensure no baseline compiler is used, see v8
|
337 |
| - benchmarkers += [ |
338 |
| - # EmscriptenBenchmarker('sm', SPIDERMONKEY_ENGINE), |
339 |
| - ] |
340 |
| - if os.path.exists(CHEERP_BIN): |
341 |
| - benchmarkers += [ |
342 |
| - # CheerpBenchmarker('cheerp-sm-wasm', SPIDERMONKEY_ENGINE), |
343 |
| - ] |
344 |
| - |
345 |
| -if config.NODE_JS and config.NODE_JS in config.JS_ENGINES: |
346 |
| - if common.EMTEST_FORCE64: |
347 |
| - benchmarkers += [ |
348 |
| - EmscriptenBenchmarker('Node.js', config.NODE_JS, ['-sMEMORY64=2']), |
349 |
| - ] |
350 |
| - else: |
351 |
| - benchmarkers += [ |
352 |
| - # EmscriptenBenchmarker('Node.js', config.NODE_JS), |
353 |
| - ] |
| 328 | + 'sm': EmscriptenBenchmarker('sm', config.SPIDERMONKEY_ENGINE), |
| 329 | + 'cherp-sm': CheerpBenchmarker('cheerp-sm-wasm', config.SPIDERMONKEY_ENGINE) |
| 330 | +} |
| 331 | + |
| 332 | +for name in EMTEST_BENCHMARKERS.split(','): |
| 333 | + if name not in named_benchmarkers: |
| 334 | + raise Exception('error, unknown benchmarker ' + name) |
| 335 | + benchmarkers.append(named_benchmarkers[name]) |
354 | 336 |
|
355 | 337 |
|
356 | 338 | class benchmark(common.RunnerCore):
|
|
0 commit comments