Skip to content

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Nov 14, 2024

This PR skips pushing a frame for String#dup when a receiver is a rb_cString and doesn't have instance variables.

It speeds up mail by 0.5%.

before: ruby 3.4.0dev (2024-11-14T17:29:47Z master 4074c6b427) +YJIT +PRISM [x86_64-linux]
after: ruby 3.4.0dev (2024-11-14T21:35:54Z yjit-str-dup e4e526ed38) +YJIT +PRISM [x86_64-linux]

-----  -----------  ----------  ----------  ----------  -------------  ------------
bench  before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
mail   69.8         0.4         69.4        0.2         1.004          1.005
-----  -----------  ----------  ----------  ----------  -------------  ------------

@k0kubun k0kubun marked this pull request as ready for review November 14, 2024 21:50
@matzbot matzbot requested a review from a team November 14, 2024 21:50
@maximecb maximecb merged commit 31bdffb into ruby:master Nov 14, 2024
71 checks passed
@k0kubun k0kubun deleted the yjit-str-dup branch November 14, 2024 23:19
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