Skip to content

Commit 85791c4

Browse files
committed
Use a single suite for all Ruby warmup benchmarks
1 parent 66f2bd0 commit 85791c4

File tree

2 files changed

+37
-26
lines changed

2 files changed

+37
-26
lines changed

ci.jsonnet

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,9 @@ local part_definitions = {
444444
chunky: { benchmarks+:: ["chunky"] },
445445
psd: { benchmarks+:: ["psd"] },
446446
asciidoctor: { benchmarks+:: ["asciidoctor"] },
447-
asciidoctor_warmup: { benchmarks+:: ["asciidoctor-warmup"] },
448447
other_extra: { benchmarks+:: ["savina"] },
449448
other: { benchmarks+:: ["micro", "image-demo", "optcarrot", "synthetic", "rubykon", "liquid"] },
449+
warmup: { benchmarks+:: ["ruby-warmup"] },
450450

451451
server: {
452452
local build = self,
@@ -615,17 +615,17 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
615615
"ruby-benchmarks-asciidoctor-svm-graal-core-multi-tier": shared + asciidoctor + svm_configurations["svm-graal-core"] + $.use.multi_tier,
616616
"ruby-benchmarks-asciidoctor-svm-graal-enterprise": shared + asciidoctor + svm_configurations["svm-graal-enterprise"],
617617
"ruby-benchmarks-asciidoctor-svm-graal-enterprise-multi-tier": shared + asciidoctor + svm_configurations["svm-graal-enterprise"] + $.use.multi_tier,
618-
local asciidoctor_warmup = $.benchmark.runner + $.benchmark.asciidoctor_warmup + { timelimit: "00:55:00" },
619-
"ruby-benchmarks-asciidoctor-mri-warmup": shared + asciidoctor_warmup + other_rubies.mri,
620-
"ruby-benchmarks-asciidoctor-jruby-warmup": shared + asciidoctor_warmup + other_rubies.jruby,
621-
"ruby-benchmarks-asciidoctor-graal-core-warmup": shared + asciidoctor_warmup + graal_configurations["graal-core"],
622-
"ruby-benchmarks-asciidoctor-graal-core-multi-tier-warmup": shared + asciidoctor_warmup + graal_configurations["graal-core"] + $.use.multi_tier,
623-
"ruby-benchmarks-asciidoctor-graal-enterprise-warmup": shared + asciidoctor_warmup + graal_configurations["graal-enterprise"],
624-
"ruby-benchmarks-asciidoctor-graal-enterprise-multi-tier-warmup": shared + asciidoctor_warmup + graal_configurations["graal-enterprise"] + $.use.multi_tier,
625-
"ruby-benchmarks-asciidoctor-svm-graal-core-warmup": shared + asciidoctor_warmup + svm_configurations["svm-graal-core"],
626-
"ruby-benchmarks-asciidoctor-svm-graal-core-multi-tier-warmup": shared + asciidoctor_warmup + svm_configurations["svm-graal-core"] + $.use.multi_tier,
627-
"ruby-benchmarks-asciidoctor-svm-graal-enterprise-warmup": shared + asciidoctor_warmup + svm_configurations["svm-graal-enterprise"],
628-
"ruby-benchmarks-asciidoctor-svm-graal-enterprise-multi-tier-warmup": shared + asciidoctor_warmup + svm_configurations["svm-graal-enterprise"] + $.use.multi_tier,
618+
local warmup = $.benchmark.runner + $.benchmark.warmup + { timelimit: "00:55:00" },
619+
"ruby-benchmarks-warmup-mri": shared + warmup + other_rubies.mri,
620+
"ruby-benchmarks-warmup-jruby": shared + warmup + other_rubies.jruby,
621+
"ruby-benchmarks-warmup-graal-core": shared + warmup + graal_configurations["graal-core"],
622+
"ruby-benchmarks-warmup-graal-core-multi-tier": shared + warmup + graal_configurations["graal-core"] + $.use.multi_tier,
623+
"ruby-benchmarks-warmup-graal-enterprise": shared + warmup + graal_configurations["graal-enterprise"],
624+
"ruby-benchmarks-warmup-graal-enterprise-multi-tier": shared + warmup + graal_configurations["graal-enterprise"] + $.use.multi_tier,
625+
"ruby-benchmarks-warmup-svm-graal-core": shared + warmup + svm_configurations["svm-graal-core"],
626+
"ruby-benchmarks-warmup-svm-graal-core-multi-tier": shared + warmup + svm_configurations["svm-graal-core"] + $.use.multi_tier,
627+
"ruby-benchmarks-warmup-svm-graal-enterprise": shared + warmup + svm_configurations["svm-graal-enterprise"],
628+
"ruby-benchmarks-warmup-svm-graal-enterprise-multi-tier": shared + warmup + svm_configurations["svm-graal-enterprise"] + $.use.multi_tier,
629629

630630
local other = $.benchmark.runner + $.benchmark.other + $.benchmark.other_extra + { timelimit: "00:40:00" },
631631
local svm_other = $.benchmark.runner + $.benchmark.other + { timelimit: "01:00:00" },

mx.truffleruby/mx_truffleruby_benchmark.py

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ def filterLines(self, lines):
272272
return data
273273

274274
def runBenchmark(self, benchmark, bmSuiteArgs):
275+
directory = self.directory()
276+
if directory is None:
277+
directory, benchmark = benchmark.split('/')
278+
275279
arguments = ['benchmark']
276280
if self.config()['kind'] == 'simple':
277281
arguments.extend(['--simple', '--elapsed', '--iterations'])
@@ -298,7 +302,7 @@ def runBenchmark(self, benchmark, bmSuiteArgs):
298302
else:
299303
benchmark_file = benchmark
300304
benchmark_names = []
301-
arguments.extend(['bench/' + self.directory() + '/' + benchmark_file + '.rb'])
305+
arguments.extend(['bench/' + directory + '/' + benchmark_file + '.rb'])
302306
arguments.extend(benchmark_names)
303307
arguments.extend(bmSuiteArgs)
304308
out = mx.OutputCapture()
@@ -507,7 +511,12 @@ def time(self):
507511
'asciidoctor-load-string'
508512
]
509513

510-
asciidoctor_benchmark_time = {'asciidoctor-convert':400, 'asciidoctor-load-file':400, 'asciidoctor-load-string':400, 'default': 120}
514+
asciidoctor_benchmark_time = {
515+
'asciidoctor-convert': 400,
516+
'asciidoctor-load-file': 400,
517+
'asciidoctor-load-string': 400,
518+
'default': 120
519+
}
511520

512521
class AsciidoctorBenchmarkSuite(AllBenchmarksBenchmarkSuite):
513522
def name(self):
@@ -672,27 +681,29 @@ def benchmarkList(self, bmSuiteArgs):
672681
def time(self):
673682
return 60
674683

675-
asciidoctor_warmup_benchmarks = [
676-
'asciidoctor-convert',
677-
'asciidoctor-load-file',
678-
'asciidoctor-load-string'
684+
warmup_benchmarks = [
685+
'asciidoctor/asciidoctor-convert',
686+
'asciidoctor/asciidoctor-load-file',
687+
'asciidoctor/asciidoctor-load-string'
679688
]
680689

681-
class AsciidoctorWarmupBenchmarkSuite(AllBenchmarksBenchmarkSuite):
690+
class WarmupBenchmarkSuite(AllBenchmarksBenchmarkSuite):
682691
def config(self):
683-
iterations = {'asciidoctor-convert': {10:'startup', 20:'early-warmup', 100:'late-warmup'},
684-
'asciidoctor-load-file': {10:'startup', 100:'early-warmup', 500:'late-warmup'},
685-
'asciidoctor-load-string': {10:'startup', 100:'early-warmup', 500:'late-warmup'}}
692+
iterations = {
693+
'asciidoctor-convert': {10:'startup', 20:'early-warmup', 100:'late-warmup'},
694+
'asciidoctor-load-file': {10:'startup', 100:'early-warmup', 500:'late-warmup'},
695+
'asciidoctor-load-string': {10:'startup', 100:'early-warmup', 500:'late-warmup'}
696+
}
686697
return {'kind': 'fixed-iterations', 'iterations': iterations}
687698

688699
def name(self):
689-
return 'asciidoctor-warmup'
700+
return 'ruby-warmup'
690701

691702
def directory(self):
692-
return 'asciidoctor'
703+
return None
693704

694705
def benchmarkList(self, bmSuiteArgs):
695-
return asciidoctor_warmup_benchmarks
706+
return warmup_benchmarks
696707

697708
mx_benchmark.add_bm_suite(BuildStatsBenchmarkSuite())
698709
mx_benchmark.add_bm_suite(AllocationBenchmarkSuite())
@@ -712,4 +723,4 @@ def benchmarkList(self, bmSuiteArgs):
712723
mx_benchmark.add_bm_suite(ServerBenchmarkSuite())
713724
mx_benchmark.add_bm_suite(RubykonBenchmarkSuite())
714725
mx_benchmark.add_bm_suite(LiquidBenchmarkSuite())
715-
mx_benchmark.add_bm_suite(AsciidoctorWarmupBenchmarkSuite())
726+
mx_benchmark.add_bm_suite(WarmupBenchmarkSuite())

0 commit comments

Comments
 (0)