Skip to content

Commit ffbfa2f

Browse files
Add support for ractor/ractor-only in burn_in.rb
I'm not entirely sure what this script is for. But it should probably support all the same benchmarks as the main benchmark runner
1 parent 8a5d1ed commit ffbfa2f

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

burn_in.rb

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
args.num_long_runs = v.to_i
4242
end
4343

44-
opts.on("--category=headline,other,micro", "when given, only benchmarks with specified categories will run") do |v|
44+
opts.on("--category=headline,other,micro,ractor,ractor-only", "when given, only benchmarks with specified categories will run") do |v|
4545
args.categories = v.split(",")
4646
end
4747

@@ -70,7 +70,7 @@ def run_benchmark(bench_id, no_yjit, logs_path, run_time, ruby_version)
7070

7171
script_path = File.join(bench_dir, bench_name, 'benchmark.rb')
7272
if not File.exist?(script_path)
73-
script_path = File.join('benchmarks', bench_name + '.rb')
73+
script_path = File.join(bench_dir, bench_name + '.rb')
7474
end
7575

7676
# Assemble random environment variable options to test
@@ -198,11 +198,38 @@ def test_loop(bench_names, no_yjit, logs_path, run_time, ruby_version)
198198

199199
# Extract the names of benchmarks in the categories we want
200200
metadata = YAML.load_file('benchmarks.yml')
201-
metadata = metadata.filter do |bench_name, entry|
202-
category = entry.fetch('category', 'other')
203-
args.categories.include? category
201+
bench_names = []
202+
203+
if args.categories.include?('ractor-only')
204+
# Only include benchmarks with ractor/ prefix (from benchmarks-ractor directory)
205+
bench_names = metadata.keys.select { |name| name.start_with?('ractor/') }
206+
elsif args.categories.include?('ractor')
207+
# Include both ractor/ prefixed benchmarks and those with ractor: true
208+
metadata.each do |name, entry|
209+
if name.start_with?('ractor/') || entry['ractor']
210+
bench_names << name
211+
end
212+
end
213+
214+
# Also include regular category benchmarks if other categories are specified
215+
if args.categories.any? { |cat| ['headline', 'other', 'micro'].include?(cat) }
216+
metadata.each do |name, entry|
217+
category = entry.fetch('category', 'other')
218+
if args.categories.include?(category) && !bench_names.include?(name)
219+
bench_names << name
220+
end
221+
end
222+
end
223+
else
224+
# Regular category filtering
225+
metadata.each do |name, entry|
226+
category = entry.fetch('category', 'other')
227+
if args.categories.include?(category)
228+
bench_names << name
229+
end
230+
end
204231
end
205-
bench_names = metadata.map { |name, entry| name }
232+
206233
bench_names.sort!
207234

208235
# Fork the test processes

0 commit comments

Comments
 (0)