-
-
Notifications
You must be signed in to change notification settings - Fork 28
Hard-code the hash selection for the fast and medium deflate algorithms #373
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
Hard-code the hash selection for the fast and medium deflate algorithms #373
Conversation
Note: This only changes the quick_insert_string calls. In testing, bypassing the hash_calc_variant check on the insert_string calls in these algorithms appears to (counterintuitively) hurt performance.
Codecov ReportAttention: Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
On my x86_64 test system (Intel i5-12400), this shows an improvement for compression levels 5 and 6 and doesn't appear to hurt the performance at levels 2 through 4.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can roughly confirm the numbers (wall_time is not significant, but the decrease in instructions seems real and makes sense).
Something to try: add some #[inline]
or #[inline(always)]
the functions. I get some mixed results when I try it, but maybe there is some combination that works also for e.g. insert_string
?
Note: This only changes the quick_insert_string calls. In testing, bypassing the hash_calc_variant check on the insert_string calls in these algorithms appears to (counterintuitively) hurt performance.