Skip to content

Commit

Permalink
For YJIT stats, set avg_len_in_yjit to 0 if denominator would be 0
Browse files Browse the repository at this point in the history
  • Loading branch information
noahgibbs committed May 9, 2023
1 parent 986268a commit a8c635e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yjit.rb
Expand Up @@ -165,7 +165,7 @@ def self.runtime_stats(context: false)
retired_in_yjit = stats[:exec_instruction] - side_exits

# Average length of instruction sequences executed by YJIT
avg_len_in_yjit = retired_in_yjit.to_f / total_exits
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)
Expand Down

0 comments on commit a8c635e

Please sign in to comment.