mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
YJIT: Filter out 0-exit ops from Top-20 exit ops (#6892)
This commit is contained in:
parent
d7812d1949
commit
1c057cfc2f
Notes:
git
2022-12-09 21:14:47 +00:00
Merged-By: k0kubun <takashikkbn@gmail.com>
4
yjit.rb
4
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|
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user