Skip to content

Commit 01d3620

Browse files
committed
Record YJIT stats in MPLR harness
1 parent 42e70fe commit 01d3620

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

harness/harness-common.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,24 @@ def get_rss
5353
YB_OUTPUT_FILE = File.expand_path yb_env_var
5454

5555
def return_results(times)
56+
yjit_bench_results = {
57+
"RUBY_DESCRIPTION" => RUBY_DESCRIPTION,
58+
"values" => times,
59+
}
60+
5661
# Collect our own peak mem usage as soon as reasonable after finishing the last iteration.
5762
peak_mem_bytes = get_rss
5863
puts "RSS: %.1fMiB" % (peak_mem_bytes / 1024.0 / 1024.0)
64+
yjit_bench_results["rss"] = peak_mem_bytes
65+
66+
if defined?(RubyVM::YJIT) && RubyVM::YJIT.stats_enabled?
67+
yjit_bench_results["yjit_stats"] = RubyVM::YJIT.runtime_stats
68+
end
5969

6070
require "json"
6171
out_path = YB_OUTPUT_FILE
6272
system('mkdir', '-p', File.dirname(out_path))
6373

64-
yjit_bench_results = {
65-
"RUBY_DESCRIPTION" => RUBY_DESCRIPTION,
66-
"values" => times,
67-
"rss" => peak_mem_bytes
68-
}
69-
7074
# Using default path? Print where we put it.
7175
puts "Writing file #{out_path}" unless ENV["RESULT_JSON_PATH"]
7276

0 commit comments

Comments
 (0)