Skip to content

Commit 5ceb59e

Browse files
committed
[GR-17905] Enable language-agnostic inlining benchmarks for Ruby.
PullRequest: truffleruby/1219
2 parents 7c2cc6e + dc0a193 commit 5ceb59e

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

ci.jsonnet

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ local part_definitions = {
198198
HOST_VM_CONFIG: "graal-enterprise",
199199
},
200200
} + svm,
201+
la_inline+: {
202+
environment+: {
203+
HOST_VM_CONFIG+: "-la-inline",
204+
TRUFFLERUBYOPT+: "--experimental-options --engine.LanguageAgnosticInlining"
205+
},
206+
},
201207
},
202208

203209
jdk: {
@@ -475,14 +481,18 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
475481
local shared = $.use.truffleruby + $.use.build + $.cap.daily + $.cap.bench,
476482

477483
"graal-core": shared + $.env.jvm_ce,
484+
"graal-core-la-inline": shared + $.env.jvm_ce + $.env.la_inline,
478485
"graal-enterprise": shared + $.env.jvm_ee,
486+
"graal-enterprise-la-inline": shared + $.env.jvm_ee + $.env.la_inline,
479487
"graal-enterprise-no-om": shared + $.env.jvm_ee + $.use.without_om,
480488
},
481489
local svm_configurations = {
482490
local shared = $.cap.bench + $.cap.daily + $.use.truffleruby + $.use.build,
483491

484492
"svm-graal-core": shared + $.env.native,
493+
"svm-graal-core-la-inline": shared + $.env.native + $.env.la_inline,
485494
"svm-graal-enterprise": shared + $.env.native_ee,
495+
"svm-graal-enterprise-la-inline": shared + $.env.native_ee + $.env.la_inline,
486496
},
487497

488498
bench_builds:
@@ -491,7 +501,9 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
491501
$.benchmark.runner + $.benchmark.compiler_metrics + { timelimit: "00:50:00" },
492502

493503
"ruby-metrics-compiler-graal-core": shared + graal_configurations["graal-core"],
504+
"ruby-metrics-compiler-graal-core-la-inline": shared + graal_configurations["graal-core-la-inline"],
494505
"ruby-metrics-compiler-graal-enterprise": shared + graal_configurations["graal-enterprise"],
506+
"ruby-metrics-compiler-graal-enterprise-la-inline": shared + graal_configurations["graal-enterprise-la-inline"],
495507
"ruby-metrics-compiler-graal-enterprise-no-om": shared + graal_configurations["graal-enterprise-no-om"],
496508
} +
497509

@@ -520,10 +532,14 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
520532
"ruby-benchmarks-classic-mri": shared + other_rubies.mri + { timelimit: "00:35:00" },
521533
"ruby-benchmarks-classic-jruby": shared + other_rubies.jruby + { timelimit: "00:35:00" },
522534
"ruby-benchmarks-classic-graal-core": shared + graal_configurations["graal-core"] + { timelimit: "00:35:00" },
535+
"ruby-benchmarks-classic-graal-core-la-inline": shared + graal_configurations["graal-core-la-inline"] + { timelimit: "00:35:00" },
523536
"ruby-benchmarks-classic-graal-enterprise": shared + graal_configurations["graal-enterprise"] + { timelimit: "00:35:00" },
537+
"ruby-benchmarks-classic-graal-enterprise-la-inline": shared + graal_configurations["graal-enterprise-la-inline"] + { timelimit: "00:35:00" },
524538
"ruby-benchmarks-classic-graal-enterprise-no-om": shared + graal_configurations["graal-enterprise-no-om"] + { timelimit: "00:35:00" },
525539
"ruby-benchmarks-classic-svm-graal-core": shared + svm_configurations["svm-graal-core"] + { timelimit: "01:10:00" },
540+
"ruby-benchmarks-classic-svm-graal-core-la-inline": shared + svm_configurations["svm-graal-core-la-inline"] + { timelimit: "01:10:00" },
526541
"ruby-benchmarks-classic-svm-graal-enterprise": shared + svm_configurations["svm-graal-enterprise"] + { timelimit: "01:10:00" },
542+
"ruby-benchmarks-classic-svm-graal-enterprise-la-inline": shared + svm_configurations["svm-graal-enterprise-la-inline"] + { timelimit: "01:10:00" },
527543
} +
528544

529545
{
@@ -533,33 +549,47 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
533549
"ruby-benchmarks-chunky-mri": shared + chunky + other_rubies.mri,
534550
"ruby-benchmarks-chunky-jruby": shared + chunky + other_rubies.jruby,
535551
"ruby-benchmarks-chunky-graal-core": shared + chunky + graal_configurations["graal-core"],
552+
"ruby-benchmarks-chunky-graal-core-la-inline": shared + chunky + graal_configurations["graal-core-la-inline"],
536553
"ruby-benchmarks-chunky-graal-enterprise": shared + chunky + graal_configurations["graal-enterprise"],
554+
"ruby-benchmarks-chunky-graal-enterprise-la-inline": shared + chunky + graal_configurations["graal-enterprise-la-inline"],
537555
"ruby-benchmarks-chunky-graal-enterprise-no-om": shared + chunky + graal_configurations["graal-enterprise-no-om"],
538556
local psd = $.benchmark.runner + $.benchmark.psd + { timelimit: "02:00:00" },
539557
"ruby-benchmarks-psd-mri": shared + psd + other_rubies.mri,
540558
"ruby-benchmarks-psd-jruby": shared + psd + other_rubies.jruby,
541559
"ruby-benchmarks-psd-graal-core": shared + psd + graal_configurations["graal-core"],
560+
"ruby-benchmarks-psd-graal-core-la-inline": shared + psd + graal_configurations["graal-core-la-inline"],
542561
"ruby-benchmarks-psd-graal-enterprise": shared + psd + graal_configurations["graal-enterprise"],
562+
"ruby-benchmarks-psd-graal-enterprise-la-inline": shared + psd + graal_configurations["graal-enterprise-la-inline"],
543563
"ruby-benchmarks-psd-graal-enterprise-no-om": shared + psd + graal_configurations["graal-enterprise-no-om"],
544564
"ruby-benchmarks-psd-svm-graal-core": shared + psd + svm_configurations["svm-graal-core"],
565+
"ruby-benchmarks-psd-svm-graal-core-la-inline": shared + psd + svm_configurations["svm-graal-core-la-inline"],
545566
"ruby-benchmarks-psd-svm-graal-enterprise": shared + psd + svm_configurations["svm-graal-enterprise"],
567+
"ruby-benchmarks-psd-svm-graal-enterprise-la-inline": shared + psd + svm_configurations["svm-graal-enterprise-la-inline"],
546568
local asciidoctor = $.benchmark.runner + $.benchmark.asciidoctor + { timelimit: "00:55:00" },
547569
"ruby-benchmarks-asciidoctor-mri": shared + asciidoctor + other_rubies.mri,
548570
"ruby-benchmarks-asciidoctor-jruby": shared + asciidoctor + other_rubies.jruby,
549571
"ruby-benchmarks-asciidoctor-graal-core": shared + asciidoctor + graal_configurations["graal-core"],
572+
"ruby-benchmarks-asciidoctor-graal-core-la-inline": shared + asciidoctor + graal_configurations["graal-core-la-inline"],
550573
"ruby-benchmarks-asciidoctor-graal-enterprise": shared + asciidoctor + graal_configurations["graal-enterprise"],
574+
"ruby-benchmarks-asciidoctor-graal-enterprise-la-inline": shared + asciidoctor + graal_configurations["graal-enterprise-la-inline"],
551575
"ruby-benchmarks-asciidoctor-graal-enterprise-no-om": shared + asciidoctor + graal_configurations["graal-enterprise-no-om"],
552576
"ruby-benchmarks-asciidoctor-svm-graal-core": shared + asciidoctor + svm_configurations["svm-graal-core"],
577+
"ruby-benchmarks-asciidoctor-svm-graal-core-la-inline": shared + asciidoctor + svm_configurations["svm-graal-core-la-inline"],
553578
"ruby-benchmarks-asciidoctor-svm-graal-enterprise": shared + asciidoctor + svm_configurations["svm-graal-enterprise"],
579+
"ruby-benchmarks-asciidoctor-svm-graal-enterprise-la-inline": shared + asciidoctor + svm_configurations["svm-graal-enterprise-la-inline"],
554580
local other = $.benchmark.runner + $.benchmark.other + $.benchmark.other_extra + { timelimit: "00:40:00" },
555581
local svm_other = $.benchmark.runner + $.benchmark.other + { timelimit: "01:00:00" },
556582
"ruby-benchmarks-other-mri": shared + other + other_rubies.mri,
557583
"ruby-benchmarks-other-jruby": shared + other + other_rubies.jruby,
558584
"ruby-benchmarks-other-graal-core": shared + other + graal_configurations["graal-core"],
585+
"ruby-benchmarks-other-graal-core-la-inline": shared + other + graal_configurations["graal-core-la-inline"],
559586
"ruby-benchmarks-other-graal-enterprise": shared + other + graal_configurations["graal-enterprise"],
587+
"ruby-benchmarks-other-graal-enterprise-la-inline": shared + other + graal_configurations["graal-enterprise-la-inline"],
560588
"ruby-benchmarks-other-graal-enterprise-no-om": shared + other + graal_configurations["graal-enterprise-no-om"],
561589
"ruby-benchmarks-other-svm-graal-core": shared + svm_other + svm_configurations["svm-graal-core"],
590+
"ruby-benchmarks-other-svm-graal-core-la-inline": shared + svm_other + svm_configurations["svm-graal-core-la-inline"],
562591
"ruby-benchmarks-other-svm-graal-enterprise": shared + svm_other + svm_configurations["svm-graal-enterprise"],
592+
"ruby-benchmarks-other-svm-graal-enterprise-la-inline": shared + svm_other + svm_configurations["svm-graal-enterprise-la-inline"],
563593
} +
564594

565595
{
@@ -570,7 +600,9 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
570600
"ruby-benchmarks-server-mri": shared + other_rubies.mri,
571601
"ruby-benchmarks-server-jruby": shared + other_rubies.jruby,
572602
"ruby-benchmarks-server-graal-core": shared + graal_configurations["graal-core"],
603+
"ruby-benchmarks-server-graal-core-la-inline": shared + graal_configurations["graal-core-la-inline"],
573604
"ruby-benchmarks-server-graal-enterprise": shared + graal_configurations["graal-enterprise"],
605+
"ruby-benchmarks-server-graal-enterprise-la-inline": shared + graal_configurations["graal-enterprise-la-inline"],
574606
"ruby-benchmarks-server-graal-enterprise-no-om": shared + graal_configurations["graal-enterprise-no-om"],
575607
} +
576608

mx.truffleruby/mx_truffleruby.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def miniruby_for_building_cexts(args):
5959
'--home=' + root,
6060
'--launcher=' + mx_binary + ' -p ' + root + ' miniruby_for_building_cexts',
6161
'--disable-gems',
62+
'--disable-rubyopt',
6263
]
6364
mx.run_java(jvm_args + ['org.truffleruby.launcher.RubyLauncher'] + options + args)
6465

src/launcher/java/org/truffleruby/launcher/RubyLauncher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ protected List<String> preprocessArguments(List<String> args, Map<String, String
8585
* being called as these options need to be passed when starting the new VM
8686
* process. The new process gets all arguments and options including those from
8787
* ENV variables. To avoid processing options from ENV variables twice,
88-
* READ_RUBYOPT is set to false. Only the native launcher can apply native and
88+
* --disable-rubyopt is passed. Only the native launcher can apply native and
8989
* jvm options (it is too late for the running JVM to apply --jvm options),
9090
* therefore this is not done on JVM.
9191
*/
9292
final int index = argumentCommandLineParser.getLastInterpreterArgumentIndex();
93-
args.add(index, "--disable=rubyopt");
93+
args.add(index, "--disable-rubyopt");
9494
args.addAll(index + 1, rubyoptArgs);
9595
args.addAll(index + 1 + rubyoptArgs.size(), trufflerubyoptArgs);
9696
}

0 commit comments

Comments
 (0)