diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-07-13 15:14:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-13 18:14:43 -0400 |
commit | d814722fb8299c4baace3e76447a55a3d5478e3a (patch) | |
tree | 9a2c1ad1a2eec7f7df26ca4deef4a52cddb3750f /yjit.rb | |
parent | e850181acf0e68a162c75d47b7a0951ab7d878b1 (diff) |
YJIT: Make ratio_in_yjit always available (#8064)
Notes
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'yjit.rb')
-rw-r--r-- | yjit.rb | 23 |
1 files changed, 8 insertions, 15 deletions
@@ -167,14 +167,11 @@ module RubyVM::YJIT # Average length of instruction sequences executed by YJIT avg_len_in_yjit = total_exits > 0 ? retired_in_yjit.to_f / total_exits : 0 - # This only available on yjit stats builds - if stats.key?(:vm_insns_count) - # Proportion of instructions that retire in YJIT - total_insns_count = retired_in_yjit + stats[:vm_insns_count] - yjit_ratio_pct = 100.0 * retired_in_yjit.to_f / total_insns_count - stats[:total_insns_count] = total_insns_count - stats[:ratio_in_yjit] = yjit_ratio_pct - end + # Proportion of instructions that retire in YJIT + total_insns_count = retired_in_yjit + stats[:vm_insns_count] + yjit_ratio_pct = 100.0 * retired_in_yjit.to_f / total_insns_count + stats[:total_insns_count] = total_insns_count + stats[:ratio_in_yjit] = yjit_ratio_pct # Make those stats available in RubyVM::YJIT.runtime_stats as well stats[:side_exit_count] = side_exits @@ -318,14 +315,10 @@ module RubyVM::YJIT out.puts "object_shape_count: " + format_number(13, stats[:object_shape_count]) out.puts "side_exit_count: " + format_number(13, stats[:side_exit_count]) out.puts "total_exit_count: " + format_number(13, stats[:total_exit_count]) - out.puts "total_insns_count: " + format_number(13, stats[:total_insns_count]) if stats.key?(:total_insns_count) - if stats.key?(:vm_insns_count) - out.puts "vm_insns_count: " + format_number(13, stats[:vm_insns_count]) - end + out.puts "total_insns_count: " + format_number(13, stats[:total_insns_count]) + out.puts "vm_insns_count: " + format_number(13, stats[:vm_insns_count]) out.puts "yjit_insns_count: " + format_number(13, stats[:exec_instruction]) - if stats.key?(:ratio_in_yjit) - out.puts "ratio_in_yjit: " + ("%12.1f" % stats[:ratio_in_yjit]) + "%" - end + out.puts "ratio_in_yjit: " + ("%12.1f" % stats[:ratio_in_yjit]) + "%" out.puts "avg_len_in_yjit: " + ("%13.1f" % stats[:avg_len_in_yjit]) print_sorted_exit_counts(stats, out: out, prefix: "exit_") |