diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-09-10 11:04:14 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:40 -0400 |
commit | cc2aa1221f96055c1d1d70ea4407b1ee12ed9a6b (patch) | |
tree | 26b4c41c52e34f5e414951230227fe4e65840729 | |
parent | cbb0271dd6256601aa6aea669ceac4f82fdb75fe (diff) | |
download | ruby-cc2aa1221f96055c1d1d70ea4407b1ee12ed9a6b.tar.gz |
Fix avg_len_in_yjit
We weren't counting completing an entire method in YJIT as exits so the
avg_len_in_yjit for
./miniruby --yjit-call-threshold=1 --yjit-stats -e'def foo; end; foo'
was infinite.
-rw-r--r-- | yjit.rb | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -162,10 +162,12 @@ module YJIT print_counters(stats, prefix: 'oaref_', prompt: 'opt_aref exit reasons: ') print_counters(stats, prefix: 'expandarray_', prompt: 'expandarray exit reasons: ') - total_exits = total_exit_count(stats) + side_exits = total_exit_count(stats) + total_exits = side_exits + stats[:leave_interp_return] - # Number of instructions that finish executing in YJIT - retired_in_yjit = stats[:exec_instruction] - total_exits + # Number of instructions that finish executing in YJIT. + # See :count-placement: about the subtraction. + 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 |