|
41 | 41 | args.num_long_runs = v.to_i |
42 | 42 | end |
43 | 43 |
|
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| |
45 | 45 | args.categories = v.split(",") |
46 | 46 | end |
47 | 47 |
|
@@ -70,7 +70,7 @@ def run_benchmark(bench_id, no_yjit, logs_path, run_time, ruby_version) |
70 | 70 |
|
71 | 71 | script_path = File.join(bench_dir, bench_name, 'benchmark.rb') |
72 | 72 | 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') |
74 | 74 | end |
75 | 75 |
|
76 | 76 | # Assemble random environment variable options to test |
@@ -198,11 +198,38 @@ def test_loop(bench_names, no_yjit, logs_path, run_time, ruby_version) |
198 | 198 |
|
199 | 199 | # Extract the names of benchmarks in the categories we want |
200 | 200 | 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 |
204 | 231 | end |
205 | | -bench_names = metadata.map { |name, entry| name } |
| 232 | + |
206 | 233 | bench_names.sort! |
207 | 234 |
|
208 | 235 | # Fork the test processes |
|
0 commit comments