Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions run_benchmarks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ def have_yjit?(ruby)
ruby_version.downcase.include?("yjit")
end

def have_zjit?(ruby)
ruby_version = check_output("#{ruby} -v --zjit", err: File::NULL).strip
ruby_version.downcase.include?("zjit")
end

# Disable Turbo Boost while running benchmarks. Maximize the CPU frequency.
def set_bench_config(turbo:)
# sudo requires the flag '-S' in order to take input from stdin
Expand Down Expand Up @@ -316,6 +321,7 @@ def run_benchmarks(ruby:, ruby_description:, categories:, name_filters:, out_pat
out_override: nil,
harness: "harness",
yjit_opts: "",
zjit_opts: "",
categories: [],
name_filters: [],
rss: false,
Expand Down Expand Up @@ -432,6 +438,9 @@ def run_benchmarks(ruby:, ruby_description:, categories:, name_filters:, out_pat
if have_yjit?(RbConfig.ruby)
args.executables["interp"] = [RbConfig.ruby]
args.executables["yjit"] = [RbConfig.ruby, "--yjit", *args.yjit_opts.shellsplit]
elsif have_zjit?(RbConfig.ruby)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want zjit checked first, or yjit first?
Are we generally building rubies with both, or just one of them?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default is still YJIT-only, and I opt-in the ZJIT-YJIT-combo build locally. So it might make sense to put ZJIT first (otherwise ZJIT is never going to be benchmarked for such people). Though I don't run run_benchmarks.rb with the Ruby to be benchmarked, so I'm fine with either of these.

args.executables["interp"] = [RbConfig.ruby]
args.executables["zjit"] = [RbConfig.ruby, "--zjit", *args.zjit_opts.shellsplit]
else
args.executables["ruby"] = [RbConfig.ruby]
end
Expand Down