@@ -284,7 +284,7 @@ def hosting_registry(self):
284
284
285
285
def run (self , cwd , args ):
286
286
_check_vm_args (self .name (), args )
287
- extra_polyglot_args = ["--experimental-options" , "--python.MaxNativeMemory=%s" % (2 ** 34 )] + self ._extra_polyglot_args
287
+ extra_polyglot_args = ["--experimental-options" , "-snapshot-startup" , "- -python.MaxNativeMemory=%s" % (2 ** 34 )] + self ._extra_polyglot_args
288
288
289
289
host_vm = self .host_vm ()
290
290
if hasattr (host_vm , 'run_lang' ): # this is a full GraalVM build
@@ -601,3 +601,58 @@ def createCommandLineArgs(self, benchmarks, bmSuiteArgs):
601
601
def get_benchmark_suites (cls , benchmarks ):
602
602
assert isinstance (benchmarks , dict ), "benchmarks must be a dict: {suite: {bench: args, ... }, ...}"
603
603
return [cls (suite_name , suite_info [0 ]) for suite_name , suite_info in benchmarks .items ()]
604
+
605
+
606
+ class PythonVmWarmupBenchmarkSuite (PythonBenchmarkSuite ):
607
+ def rules (self , output , benchmarks , bm_suite_args ):
608
+ bench_name = self .get_bench_name (benchmarks )
609
+ arg = self .get_arg (bench_name )
610
+
611
+ return [
612
+ # startup (difference between start of VM to end of first iteration)
613
+ StdOutRule (
614
+ r"### STARTUP +at iteration: (?P<iteration>[0-9]+), +duration: (?P<time>[0-9]+(\.[0-9]+)?$)" ,
615
+ {
616
+ "benchmark" : '{}.{}' .format (self ._name , bench_name ),
617
+ "metric.name" : "startup" ,
618
+ "metric.iteration" : ("<iteration>" , int ),
619
+ "metric.type" : "numeric" ,
620
+ "metric.value" : ("<time>" , float ),
621
+ "metric.unit" : "s" ,
622
+ "metric.score-function" : "id" ,
623
+ "metric.better" : "lower" ,
624
+ "config.run-flags" : "" .join (arg ),
625
+ }
626
+ ),
627
+
628
+ StdOutRule (
629
+ r"### EARLY WARMUP +at iteration: (?P<iteration>[0-9]+), +duration: (?P<time>[0-9]+(\.[0-9]+)?$)" ,
630
+ {
631
+ "benchmark" : '{}.{}' .format (self ._name , bench_name ),
632
+ "metric.name" : "early-warmup" ,
633
+ "metric.iteration" : ("<iteration>" , int ),
634
+ "metric.type" : "numeric" ,
635
+ "metric.value" : ("<time>" , float ),
636
+ "metric.unit" : "s" ,
637
+ "metric.score-function" : "id" ,
638
+ "metric.better" : "lower" ,
639
+ "config.run-flags" : "" .join (arg ),
640
+ }
641
+ ),
642
+
643
+ StdOutRule (
644
+ r"### LATE WARMUP +at iteration: (?P<iteration>[0-9]+), +duration: (?P<time>[0-9]+(\.[0-9]+)?$)" ,
645
+ {
646
+ "benchmark" : '{}.{}' .format (self ._name , bench_name ),
647
+ "metric.name" : "late-warmup" ,
648
+ "metric.iteration" : ("<iteration>" , int ),
649
+ "metric.type" : "numeric" ,
650
+ "metric.value" : ("<time>" , float ),
651
+ "metric.unit" : "s" ,
652
+ "metric.score-function" : "id" ,
653
+ "metric.better" : "lower" ,
654
+ "config.run-flags" : "" .join (arg ),
655
+ }
656
+ ),
657
+ ]
658
+
0 commit comments