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: add specialized codegen for fixnum XOR #9763

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

maximecb
Copy link
Contributor

@maximecb maximecb commented Jan 30, 2024

Big speedup!

Before:

--------  -----------  ----------  ---------  ----------  ------------  -----------
bench     interp (ms)  stddev (%)  yjit (ms)  stddev (%)  yjit 1st itr  interp/yjit
ruby-xor  982.2        0.2         123.8      0.6         7.46          7.93       
--------  -----------  ----------  ---------  ----------  ------------  -----------

After:

--------  -----------  ----------  ---------  ----------  ------------  -----------
bench     interp (ms)  stddev (%)  yjit (ms)  stddev (%)  yjit 1st itr  interp/yjit
ruby-xor  993.2        0.3         109.4      0.5         8.44          9.08       
--------  -----------  ----------  ---------  ----------  ------------  -----------

Top C calls:

Top-8 most frequent C calls (19.9% of C calls):
        String#setbyte:  6,498,050 (19.6%)
            String#dup:     99,971 ( 0.3%)
           Symbol#to_s:        445 ( 0.0%)

I will look at adding some specialized codegen for String#setbyte next.

@maximecb maximecb self-assigned this Jan 30, 2024
@matzbot matzbot requested a review from a team January 30, 2024 18:10
Comment on lines +1 to +3
# To run the tests in this file only, with YJIT enabled:
# make btest BTESTS=bootstraptest/test_yjit.rb RUN_OPTS="--yjit-call-threshold=1"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I'm always looking for the exact incantation 😅

@maximecb maximecb merged commit fe5590e into ruby:master Jan 30, 2024
98 checks passed
@maximecb maximecb deleted the yjit_can_xor_too branch January 30, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants