@@ -352,13 +352,7 @@ def with_host_vm(self, host_vm):
352
352
return self .__class__ (self .config_name (), self ._options , host_vm )
353
353
354
354
def run (self , cwd , args ):
355
- ## patch host-vm name
356
- name = self .host_vm .name ()
357
- name = name .replace ("graalvm-ce-python" , "graalvm-ce" )
358
- name = name .replace ("graalvm-ee-python" , "graalvm-ee" )
359
- type(host_vm ).name = lambda s : name
360
-
361
- for idx ,arg in enumerate (args ):
355
+ for idx , arg in enumerate (args ):
362
356
if "--vm.Xmx" in arg :
363
357
mx .log (f"Setting Xmx from { arg } " )
364
358
break
@@ -392,14 +386,16 @@ def run(self, cwd, args):
392
386
env = os .environ .copy ()
393
387
xmxArg = re .compile ("--vm.Xmx([0-9]+)([kKgGmM])" )
394
388
pypyGcMax = "8GB"
395
- for idx ,arg in enumerate (args ):
389
+ for idx , arg in enumerate (args ):
396
390
if m := xmxArg .search (arg ):
397
- args = args [:idx ] + args [idx + 1 :]
391
+ args = args [:idx ] + args [idx + 1 :]
398
392
pypyGcMax = f"{ m .group (1 )} { m .group (2 ).upper ()} B"
399
393
mx .log (f"Setting PYPY_GC_MAX={ pypyGcMax } via { arg } " )
400
394
break
401
395
else :
402
- mx .log (f"Setting PYPY_GC_MAX={ pypyGcMax } , use --vm.Xmx argument to override it" )
396
+ mx .log (
397
+ f"Setting PYPY_GC_MAX={ pypyGcMax } , use --vm.Xmx argument to override it"
398
+ )
403
399
env ["PYPY_GC_MAX" ] = pypyGcMax
404
400
return mx .run ([self .interpreter ()] + args , cwd = cwd , env = env )
405
401
@@ -424,10 +420,10 @@ def interpreter(self):
424
420
return join (home , "bin" , "python" )
425
421
426
422
def run (self , cwd , args ):
427
- for idx ,arg in enumerate (args ):
423
+ for idx , arg in enumerate (args ):
428
424
if "--vm.Xmx" in arg :
429
425
mx .warn (f"Ignoring { arg } , cannot restrict memory on CPython." )
430
- args = args [:idx ] + args [idx + 1 :]
426
+ args = args [:idx ] + args [idx + 1 :]
431
427
break
432
428
return mx .run ([self .interpreter ()] + args , cwd = cwd )
433
429
@@ -447,9 +443,23 @@ def __iter__(self):
447
443
)
448
444
449
445
450
- class PyPerformanceSuite (
451
- mx_benchmark .TemporaryWorkdirMixin , mx_benchmark .VmBenchmarkSuite
452
- ):
446
+ class PySuite (mx_benchmark .TemporaryWorkdirMixin , mx_benchmark .VmBenchmarkSuite ):
447
+ def runAndReturnStdOut (self , benchmarks , bmSuiteArgs ):
448
+ ret_code , out , dims = super ().runAndReturnStdOut (benchmarks , bmSuiteArgs )
449
+
450
+ def _replace_host_vm (old , new ):
451
+ host_vm = dims .get ("host-vm" )
452
+ if host_vm and old in host_vm :
453
+ dims ['host-vm' ] = host_vm .replace (old , new )
454
+ mx .logv (f"[DEBUG] replace 'host-vm': '{ host_vm } ' -> '{ dims ['host-vm' ]} '" )
455
+
456
+ _replace_host_vm ('graalvm-ce-python' , 'graalvm-ce' )
457
+ _replace_host_vm ('graalvm-ee-python' , 'graalvm-ee' )
458
+
459
+ return ret_code , out , dims
460
+
461
+
462
+ class PyPerformanceSuite (PySuite ):
453
463
VERSION = "1.0.5"
454
464
455
465
def name (self ):
@@ -513,7 +523,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
513
523
return 0 , join (workdir , json_file )
514
524
515
525
516
- class PyPySuite (mx_benchmark . TemporaryWorkdirMixin , mx_benchmark . VmBenchmarkSuite ):
526
+ class PyPySuite (PySuite ):
517
527
VERSION = "0324a252cf1a"
518
528
519
529
def name (self ):
@@ -594,7 +604,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
594
604
return 0 , join (workdir , json_file )
595
605
596
606
597
- class NumPySuite (mx_benchmark . TemporaryWorkdirMixin , mx_benchmark . VmBenchmarkSuite ):
607
+ class NumPySuite (PySuite ):
598
608
VERSION = "v1.16.4"
599
609
ASV = "0.5.1"
600
610
VIRTUALENV = "20.16.3"
0 commit comments