Skip to content

Commit ab41282

Browse files
committed
Add ZJIT to run_benchmarks.rb
This at least will compare against ZJIT if present.
1 parent b5218ea commit ab41282

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

run_benchmarks.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ def have_yjit?(ruby)
5757
ruby_version.downcase.include?("yjit")
5858
end
5959

60+
def have_zjit?(ruby)
61+
ruby_version = check_output("#{ruby} -v --zjit", err: File::NULL).strip
62+
ruby_version.downcase.include?("zjit")
63+
end
64+
6065
# Disable Turbo Boost while running benchmarks. Maximize the CPU frequency.
6166
def set_bench_config(turbo:)
6267
# sudo requires the flag '-S' in order to take input from stdin
@@ -316,6 +321,7 @@ def run_benchmarks(ruby:, ruby_description:, categories:, name_filters:, out_pat
316321
out_override: nil,
317322
harness: "harness",
318323
yjit_opts: "",
324+
zjit_opts: "",
319325
categories: [],
320326
name_filters: [],
321327
rss: false,
@@ -432,6 +438,9 @@ def run_benchmarks(ruby:, ruby_description:, categories:, name_filters:, out_pat
432438
if have_yjit?(RbConfig.ruby)
433439
args.executables["interp"] = [RbConfig.ruby]
434440
args.executables["yjit"] = [RbConfig.ruby, "--yjit", *args.yjit_opts.shellsplit]
441+
elsif have_zjit?(RbConfig.ruby)
442+
args.executables["interp"] = [RbConfig.ruby]
443+
args.executables["zjit"] = [RbConfig.ruby, "--zjit", *args.zjit_opts.shellsplit]
435444
else
436445
args.executables["ruby"] = [RbConfig.ruby]
437446
end

0 commit comments

Comments
 (0)