Skip to content

Commit 59b7f86

Browse files
authored
Print YJIT code size besides RSS (#319)
* Print YJIT code size besides RSS * Always keep YJIT stats
1 parent ca6b1c6 commit 59b7f86

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

harness/harness-common.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,15 @@ def return_results(warmup_iterations, bench_iterations)
9898
yjit_bench_results["maxrss"] = maxrss
9999
end
100100

101-
if defined?(RubyVM::YJIT) && RubyVM::YJIT.stats_enabled?
102-
yjit_bench_results["yjit_stats"] = RubyVM::YJIT.runtime_stats
101+
if defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?
102+
yjit_stats = RubyVM::YJIT.runtime_stats
103+
yjit_bench_results["yjit_stats"] = yjit_stats
104+
105+
formatted_stats = proc { |key| "%10s" % yjit_stats[key].to_s.reverse.scan(/\d{1,3}/).join(",").reverse }
106+
puts "inline_code_size: #{formatted_stats[:inline_code_size]}"
107+
puts "outlined_code_size: #{formatted_stats[:outlined_code_size]}"
108+
puts "code_region_size: #{formatted_stats[:code_region_size]}"
109+
puts "yjit_alloc_size: #{formatted_stats[:yjit_alloc_size]}"
103110
end
104111

105112
write_json_file(yjit_bench_results)

0 commit comments

Comments
 (0)