Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YJIT: Prefer an overloaded cme if available #9913

Merged
merged 1 commit into from Feb 12, 2024

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Feb 10, 2024

This PR adds support for overloaded cme. It allows Array#first and Array#last to be considered leaf.

Since #5112, ISEQs can be overloaded. Array#first and Array#last are one of such examples (#7486), and they are leaf only in the overloaded version.

It speeds up rubykon by 3%, which calls Array#first fairly frequently:

before: ruby 3.4.0dev (2024-02-10T00:23:17Z master ea91ab696e) +YJIT [x86_64-linux]
after: ruby 3.4.0dev (2024-02-10T01:13:04Z yjit-mandatory dae393743e) +YJIT [x86_64-linux]

-------  -----------  ----------  ----------  ----------  -------------  ------------
bench    before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
rubykon  8022.2       1.2         7818.6      1.0         1.02           1.03
-------  -----------  ----------  ----------  ----------  -------------  ------------

@k0kubun k0kubun marked this pull request as ready for review February 10, 2024 01:34
@matzbot matzbot requested a review from a team February 10, 2024 01:34
@maximecb maximecb merged commit e4d3e65 into ruby:master Feb 12, 2024
98 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants