Skip to content

Commit 70fc3a8

Browse files
authored
Merge pull request #471 from ruby/rwstauner/zjit-diff
Add script to diff zjit stats from output csv
2 parents 6810ecd + 696db7b commit 70fc3a8

File tree

2 files changed

+465
-21
lines changed

2 files changed

+465
-21
lines changed

harness/harness-common.rb

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -154,29 +154,33 @@ def return_results(warmup_iterations, bench_iterations)
154154
end
155155

156156
# If YJIT or ZJIT is enabled, show some of its stats unless it does by itself.
157-
if yjit_stats && !RubyVM::YJIT.stats_enabled?
157+
if yjit_stats
158158
yjit_bench_results["yjit_stats"] = yjit_stats
159-
stats_keys = [
160-
*ENV.fetch("YJIT_BENCH_STATS", "").split(",").map(&:to_sym),
161-
:inline_code_size,
162-
:outlined_code_size,
163-
:code_region_size,
164-
:yjit_alloc_size,
165-
:compile_time_ns,
166-
].uniq
167-
puts "YJIT stats:"
168-
elsif zjit_stats && defined?(RubyVM::ZJIT.stats_enabled?) && !RubyVM::ZJIT.stats_enabled?
159+
if !RubyVM::YJIT.stats_enabled?
160+
stats_keys = [
161+
*ENV.fetch("YJIT_BENCH_STATS", "").split(",").map(&:to_sym),
162+
:inline_code_size,
163+
:outlined_code_size,
164+
:code_region_size,
165+
:yjit_alloc_size,
166+
:compile_time_ns,
167+
].uniq
168+
puts "YJIT stats:"
169+
end
170+
elsif zjit_stats
169171
yjit_bench_results["zjit_stats"] = zjit_stats
170-
stats_keys = [
171-
*ENV.fetch("ZJIT_BENCH_STATS", "").split(",").map(&:to_sym),
172-
:code_region_bytes,
173-
:zjit_alloc_bytes,
174-
:compile_time_ns,
175-
:profile_time_ns,
176-
:gc_time_ns,
177-
:invalidation_time_ns,
178-
].uniq
179-
puts "ZJIT stats:"
172+
if defined?(RubyVM::ZJIT.stats_enabled?) && !RubyVM::ZJIT.stats_enabled?
173+
stats_keys = [
174+
*ENV.fetch("ZJIT_BENCH_STATS", "").split(",").map(&:to_sym),
175+
:code_region_bytes,
176+
:zjit_alloc_bytes,
177+
:compile_time_ns,
178+
:profile_time_ns,
179+
:gc_time_ns,
180+
:invalidation_time_ns,
181+
].uniq
182+
puts "ZJIT stats:"
183+
end
180184
end
181185
if stats_keys
182186
jit_stats = yjit_stats || zjit_stats

0 commit comments

Comments
 (0)