8000 YJIT: Move Integer#downto, Array#select, and Array#map to Ruby by k0kubun · Pull Request #12074 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

YJIT: Move Integer#downto, Array#select, and Array#map to Ruby #12074

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

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

k0kubun
Copy link
Member
@k0kubun k0kubun commented Nov 13, 2024

This PR reverts #11275, which reverted #11093 #11094 #11095, using #11955.

Benchmark

This PR speeds up chunky-png by 19%, activerecord by 2%, and mail by 1%. No significant impact on lobsters.

before: ruby 3.4.0dev (2024-11-13T17:25:09Z master beafae9750) +YJIT +PRISM [x86_64-linux]
after: ruby 3.4.0dev (2024-11-13T18:24:43Z yjit-ruby-mode 86ac81c7dd) +YJIT +PRISM [x86_64-linux]

------------  -----------  ----------  ----------  ----------  -------------  ------------
bench         before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
activerecord  98.3         1.0         96.5        0.1         1.13           1.02
chunky-png    297.3        0.2         249.9       0.4         1.16           1.19
lobsters      512.6        1.9         513.0       1.8         1.01           1.00
mail          69.9         0.7         69.5        0.2         0.99           1.01
------------  -----------  ----------  ----------  ----------  -------------  ------------

Memory usage

activerecord

1.0% increase in inline_code_size

stat before after
inline_code_size 866,919 875,504
outlined_code_size 770,517 849,262
code_region_size 2,240,512 2,273,280
yjit_alloc_size 5,592,458 5,632,050
compiled_block_count 14,327 14,457

chunky-png

7.0% increase in inline_code_size

stat before after
inline_code_size 175,307 187,500
outlined_code_size 119,935 186,620
code_region_size 475,136 507,904
yjit_alloc_size 1,320,635 1,384,515
compiled_block_count 2,998 3,190

lobsters

0.8% increase in inline_code_size

stat before after
inline_code_size 4,670,932 4,708,604
outlined_code_size 4,246,037 4,334,887
code_region_size 11,436,032 11,567,104
yjit_alloc_size 26,436,801 26,599,621
compiled_block_count 70,514 71,085

mail

2.1% increase in inline_code_size

stat before after
inline_code_size 433,797 442,989
outlined_code_size 413,118 468,219
code_region_size 1,196,032 1,224,704
yjit_alloc_size 3,347,375 3,387,751
compiled_block_count 7,479 7,613

This comment has been minimized.

k0kubun and others added 2 commits November 13, 2024 09:38
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
@k0kubun k0kubun force-pushed the yjit-ruby-mode branch 2 times, most recently from 13901a1 to 3be4cc0 Compare November 13, 2024 18:02
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
@k0kubun k0kubun marked this pull request as ready for review November 13, 2024 18:46
@k0kubun k0kubun requested a review from a team November 13, 2024 18:46
Copy link
Contributor
@maximecb maximecb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking at the code size.

I would assume that SFR/Core are going to be relatively similar to lobsters, and so the impact on code size seems acceptable 👍

@k0kubun k0kubun enabled auto-merge (rebase) November 13, 2024 19:59
@k0kubun k0kubun merged commit 9071469 into ruby:master Nov 13, 2024
69 checks passed
@k0kubun k0kubun deleted the yjit-ruby-mode branch November 13, 2024 20:58
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
0