Skip to content

Commit

Permalink
Add "prev_ruby_yjit" config to compare yjit 3.3 with yjit dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rwstauner committed May 9, 2024
1 parent 271437b commit e92eb17
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
13 changes: 11 additions & 2 deletions basic_benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@
opts: MJIT_ENABLED_OPTS + [ "--mjit-verbose=1" ],
per_os_prefix: MJIT_PER_OS_OPTS,
},
"prev_ruby_yjit" => {
build: "ruby-3.3.1",
opts: YJIT_ENABLED_OPTS,
per_os_prefix: YJIT_PER_OS_OPTS,
},
"ruby_30" => {
build: "ruby-3.0.2",
opts: [],
Expand Down Expand Up @@ -138,7 +143,7 @@
min_bench_itrs: DEFAULT_MIN_BENCH_ITRS,
min_bench_time: DEFAULT_MIN_BENCH_TIME,
}
DEFAULT_CONFIGS = %w(yjit_stats prod_ruby_with_yjit prod_ruby_no_jit)
DEFAULT_CONFIGS = %w(yjit_stats prod_ruby_with_yjit prod_ruby_no_jit prev_ruby_yjit)
configs_to_test = DEFAULT_CONFIGS.map { |config| "#{YJITMetrics::PLATFORM}_#{config}"}
bench_data = nil
when_error = :report
Expand Down Expand Up @@ -297,6 +302,10 @@ def full_clean_yjit_cruby(flavor)
config_opts: [ "--disable-install-doc", "--disable-install-rdoc", "--enable-yjit" ] + extra_config_options,
full_clean: full_clean_yjit_cruby("prod"),
},
"ruby-3.3.1" => {
install: "ruby-build",
full_clean: "rm -rf ~/.rubies/ruby-3.3.1",
},
"ruby-3.0.0" => {
install: "ruby-install",
full_clean: "rm -rf ~/.rubies/ruby-3.0.0",
Expand Down Expand Up @@ -401,7 +410,7 @@ def this_os
when "ruby-build"
next if installed_rubies.include?(ruby_build)
puts "Installing Ruby #{ruby_build} via ruby-build..."
YJITMetrics.check_call("ruby-build #{ruby_build} ~/.rubies/#{ruby_build}")
YJITMetrics.check_call("ruby-build #{ruby_build} #{CHRUBY_RUBIES}/#{ruby_build}")
when "repo"
YJITMetrics.clone_ruby_repo_with \
path: build_info[:repo_path],
Expand Down
7 changes: 7 additions & 0 deletions lib/yjit-metrics/bench-results.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def platforms
# metadata?) and make sure the config does what it's labelled as.
CONFIG_NAME_SPECIAL_CASE_FRAGMENTS = {
"with_yjit" => "YJIT",
"prev_ruby_yjit" => "YJIT 3.3",
"prod_ruby_with_mjit" => "MJIT",
"ruby_30_with_mjit" => "MJIT-3.0",
"no_jit" => "No JIT",
Expand Down Expand Up @@ -641,6 +642,9 @@ module YJITMetrics
"x86_64_prod_ruby_with_yjit" => {
max_warmup_itrs: 30,
},
"x86_64_prev_ruby_yjit" => {
max_warmup_itrs: 30,
},
#"x86_64_prod_ruby_with_mjit" => {
# max_warmup_itrs: 75,
# max_warmup_time: 300, # in seconds; we try to let MJIT warm up "enough," but time and iters vary by workload
Expand All @@ -654,6 +658,9 @@ module YJITMetrics
"aarch64_prod_ruby_with_yjit" => {
max_warmup_itrs: 30,
},
"aarch64_prev_ruby_yjit" => {
max_warmup_itrs: 30,
},
},
# Non-config-specific settings
"min_bench_itrs" => 15,
Expand Down
3 changes: 3 additions & 0 deletions lib/yjit-metrics/report_templates/blog_speed_details.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

<p>
Tested Ruby version for YJIT and No-JIT: <tt><strong><%= @ruby_metadata_by_config[@with_yjit_config]["RUBY_DESCRIPTION"] %></strong></tt> <br/>
<% if @with_prev_yjit_config %>
Tested Ruby version for Ruby 3.3 YJIT: <tt><strong><%= @ruby_metadata_by_config[@with_prev_yjit_config]["RUBY_DESCRIPTION"] %></strong></tt> <br/>
<% end %>
<% if @with_mjit_latest_config %>
Tested Ruby version for Ruby latest MJIT: <tt><strong><%= @ruby_metadata_by_config[@with_mjit_latest_config]["RUBY_DESCRIPTION"] %></strong></tt> <br/>
<% end %>
Expand Down
2 changes: 2 additions & 0 deletions lib/yjit-metrics/report_types/bloggable_speed_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def look_up_data_by_ruby(only_platforms: YJITMetrics::PLATFORMS, in_runs: false)
raise "No data files for platform(s) #{only_platforms.inspect} in #{@config_names}!" if config_names.empty?

@with_yjit_config = exactly_one_config_with_name(config_names, "with_yjit", "with-YJIT")
@with_prev_yjit_config = exactly_one_config_with_name(config_names, "prev_ruby_yjit", "prev-YJIT", none_okay: true)
@with_mjit30_config = exactly_one_config_with_name(config_names, "ruby_30_with_mjit", "with-MJIT3.0", none_okay: true)
@with_mjit_latest_config = exactly_one_config_with_name(config_names, "prod_ruby_with_mjit", "with-MJIT", none_okay: true)
@no_jit_config = exactly_one_config_with_name(config_names, "no_jit", "no-JIT")
Expand All @@ -55,6 +56,7 @@ def look_up_data_by_ruby(only_platforms: YJITMetrics::PLATFORMS, in_runs: false)
]
@configs_with_human_names.push(["MJIT3.0", @with_mjit30_config]) if @with_mjit30_config
@configs_with_human_names.push(["MJIT", @with_mjit_latest_config]) if @with_mjit_latest_config
@configs_with_human_names.push(["YJIT 3.3", @with_prev_yjit_config]) if @with_prev_yjit_config
@configs_with_human_names.push(["YJIT", @with_yjit_config])
@configs_with_human_names.push(["Truffle", @truffle_config]) if @truffle_config

Expand Down
1 change: 1 addition & 0 deletions lib/yjit-metrics/report_types/variable_warmup_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def look_up_data_by_ruby
configs = @result_set.config_names
config_order = configs.select { |c| c["prod_ruby_no_jit"] }.sort
config_order += configs.select { |c| c["prod_ruby_with_mjit"] }.sort # MJIT is optional, may be empty
config_order += configs.select { |c| c["prev_ruby_yjit"] }.sort # optional
config_order += configs.select { |c| c["prod_ruby_with_yjit"] }.sort
config_order += configs.select { |c| c["with_stats"] }.sort # Stats configs *also* take time to run
@configs_with_human_names = @result_set.configs_with_human_names(config_order)
Expand Down

0 comments on commit e92eb17

Please sign in to comment.