Skip to content

YJIT: Handle 0 total_exits YJIT Status Display#6079

Merged
maximecb merged 1 commit into
ruby:masterfrom
dorkrawk:fix-NaN-JIT-stats
Jun 30, 2022
Merged

YJIT: Handle 0 total_exits YJIT Status Display#6079
maximecb merged 1 commit into
ruby:masterfrom
dorkrawk:fix-NaN-JIT-stats

Conversation

@dorkrawk

Copy link
Copy Markdown
Contributor

Currently if there are 0 total_exits the YJIT stats display we see a lot of NaN's in the output due to dividing by 0 in the display code:

Before Example:

yjit_insns_count:            4955
ratio_in_yjit:              91.1%
avg_len_in_yjit:              5.0
Top-20 most frequent exit ops (NaN% of exits):
    trace_putobject_INT2FIX_1_:          0 (NaN%)
                           nop:          0 (NaN%)
                      getlocal:          0 (NaN%)
                      setlocal:          0 (NaN%)
                 getblockparam:          0 (NaN%)
                 setblockparam:          0 (NaN%)
...

This change gets rid of the "Top-20 most frequent exit ops..." line and replaces it with a total_exit count line

After Example:

yjit_insns_count:            3964
ratio_in_yjit:              89.1%
avg_len_in_yjit:              4.0
total_exits:                    0

@maximecb

Copy link
Copy Markdown
Contributor

Well done Dave :)

@maximecb maximecb merged commit 2366e14 into ruby:master Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants