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

Improve: Call target directly from unsafe_ifunc macro whenever possible. #165

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sewer56
Copy link

@Sewer56 Sewer56 commented Oct 9, 2024

Example based on discussion from:

This is just an example of the sort of improvement/change I had in mind:

Before:

RUSTFLAGS="-C target-cpu=x86-64-v3" cargo bench:

[create_string_pool_4000_V0] Packed size: 200343 bytes
unpack_string_pool_4000_V0
                        time:   [27.400 µs 27.523 µs 27.663 µs]
                        change: [-2.8856% -2.2842% -1.6698%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  6 (6.00%) high mild
  3 (3.00%) high severe

After, with no_std:

[create_string_pool_4000_V0] Packed size: 200343 bytes
unpack_string_pool_4000_V0
                        time:   [26.712 µs 26.769 µs 26.847 µs]
                        change: [-2.3623% -2.1856% -1.9750%] (p = 0.00 < 0.05)
                        Performance has improved.

Test is more than just use of memchr; it's on a real scenario involving memchr.
So this isn't a '2%' improvement, raw improvement is closer to '4%'.

For more details see:

@Sewer56
Copy link
Author

Sewer56 commented Oct 9, 2024

CI Failure is not caused by this commit.

This Actions Run
https://github.com/BurntSushi/memchr/actions/runs/11258409805

Was ran with commit reverted, i.e. using code from master.

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.

1 participant