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: Decrease IVAR_MAX_DEPTH to 8 #8398

Merged
merged 1 commit into from
Sep 8, 2023
Merged

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Sep 7, 2023

I tested 5, 8, and 10 as GET_IVAR_MAX_DEPTH and SET_IVAR_MAX_DEPTH on SFR. depth=8 showed the best latency, and it had almost the same max code size as depth=5, which is 1.6% smaller than depth=10's.

@matzbot matzbot requested a review from a team September 7, 2023 20:52
@maximecb
Copy link
Contributor

maximecb commented Sep 7, 2023

Thanks for running this experiment 🙏

Would just like to see the perf impact of depth 8 vs 10 on headline benchmarks before we merge.

@k0kubun
Copy link
Member Author

k0kubun commented Sep 7, 2023

Here's the results:

before: ruby 3.3.0dev (2023-09-07T18:22:34Z master fcdedf7f47) +YJIT [x86_64-linux]
after: ruby 3.3.0dev (2023-09-07T20:49:45Z yjit-ivar-8 322ac79141) +YJIT [x86_64-linux]

--------------  -----------  ----------  ---------  ----------  ----------  ---------  -------------  ------------
bench           before (ms)  stddev (%)  RSS (MiB)  after (ms)  stddev (%)  RSS (MiB)  after 1st itr  before/after
activerecord    31.3         5.6         56.4       31.2        5.3         56.4       0.98           1.00
chunky-png      399.5        0.6         57.6       399.2       0.5         50.5       1.01           1.00
erubi-rails     10.5         28.2        103.7      10.5        30.8        97.2       1.03           1.00
hexapdf         1343.4       1.1         272.9      1381.8      1.2         264.3      1.01           0.97
liquid-c        38.8         0.7         39.6       38.6        0.7         39.7       1.00           1.00
liquid-compile  39.8         0.6         34.8       39.8        0.8         34.7       1.00           1.00
liquid-render   56.2         0.3         38.0       56.5        0.3         38.0       1.00           1.00
lobsters        615.9        5.1         331.5      611.3       3.8         331.1      1.00           1.01
mail            82.4         0.3         50.2       82.9        0.2         50.6       0.99           0.99
psych-load      1234.0       0.2         36.5       1237.1      0.2         36.3       1.00           1.00
railsbench      1112.7       1.4         104.4      1116.8      1.3         102.8      0.99           1.00
ruby-lsp        36.1         26.8        130.6      36.0        26.5        129.9      1.01           1.00
sequel          47.3         2.0         40.9       47.3        1.7         40.8       1.00           1.00
--------------  -----------  ----------  ---------  ----------  ----------  ---------  -------------  ------------

Most benchmarks seem not impacted, but hexapdf does slow down a little.

@maximecb maximecb merged commit 89edce4 into ruby:master Sep 8, 2023
95 checks passed
@k0kubun k0kubun deleted the yjit-ivar-8 branch September 8, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants