summaryrefslogtreecommitdiff
path: root/yjit.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-12-09 13:14:19 -0800
committerGitHub <noreply@github.com>2022-12-09 13:14:19 -0800
commit1c057cfc2fd84369a2ebff048c4a5fdf5fa08fff (patch)
tree75f0981211ce166771a0f5ad0bfc005639db689b /yjit.rb
parentd7812d1949b6315eff5088c6f74eaf9ef6b34119 (diff)
downloadruby-1c057cfc2fd84369a2ebff048c4a5fdf5fa08fff.tar.gz
YJIT: Filter out 0-exit ops from Top-20 exit ops (#6892)
Diffstat (limited to 'yjit.rb')
-rw-r--r--yjit.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/yjit.rb b/yjit.rb
index cc99a31648..a487f23b52 100644
--- a/yjit.rb
+++ b/yjit.rb
@@ -299,14 +299,14 @@ module RubyVM::YJIT
end
end
- exits = exits.sort_by { |name, count| -count }[0...how_many]
+ exits = exits.select { |_name, count| count > 0 }.sort_by { |_name, count| -count }.first(how_many)
total_exits = total_exit_count(stats)
if total_exits > 0
top_n_total = exits.map { |name, count| count }.sum
top_n_exit_pct = 100.0 * top_n_total / total_exits
- $stderr.puts "Top-#{how_many} most frequent exit ops (#{"%.1f" % top_n_exit_pct}% of exits):"
+ $stderr.puts "Top-#{exits.size} most frequent exit ops (#{"%.1f" % top_n_exit_pct}% of exits):"
longest_insn_name_len = exits.map { |name, count| name.length }.max
exits.each do |name, count|