Skip to content

Commit fe8e2eb

Browse files
committed
Extract directory setup to a private method
1 parent b572f10 commit fe8e2eb

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

lib/benchmark_suite.rb

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,7 @@ def initialize(ruby:, ruby_description:, categories:, name_filters:, out_path:,
3131
@no_pinning = no_pinning
3232
@ractor_only = (categories == RACTOR_ONLY_CATEGORY)
3333

34-
@bench_dir = BENCHMARKS_DIR
35-
@ractor_bench_dir = RACTOR_BENCHMARKS_DIR
36-
37-
if @ractor_only
38-
@bench_dir = @ractor_bench_dir
39-
@harness = RACTOR_HARNESS
40-
@categories = []
41-
end
34+
setup_benchmark_directories
4235
end
4336

4437
# Run all the benchmarks and record execution times
@@ -69,6 +62,18 @@ def run
6962

7063
private
7164

65+
def setup_benchmark_directories
66+
if @ractor_only
67+
@bench_dir = RACTOR_BENCHMARKS_DIR
68+
@ractor_bench_dir = RACTOR_BENCHMARKS_DIR
69+
@harness = RACTOR_HARNESS
70+
@categories = []
71+
else
72+
@bench_dir = BENCHMARKS_DIR
73+
@ractor_bench_dir = RACTOR_BENCHMARKS_DIR
74+
end
75+
end
76+
7277
def process_benchmark_result(result_json_path, command)
7378
JSON.parse(File.read(result_json_path)).tap do |json|
7479
json["command_line"] = command

0 commit comments

Comments
 (0)