-
-
Notifications
You must be signed in to change notification settings - Fork 28
Remove the cloning of scan_start & scan_end in longest_match_help #268
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
Remove the cloning of scan_start & scan_end in longest_match_help #268
Conversation
brian-pane
commented
Dec 20, 2024
This change seems to improve performance at compression levels 2 and higher on my test system. Maybe I'm missing something, though, because zlib-ng copies into |
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.
This gives a consistent reduction in instruction count for me, for levels 2..=9, and simplifies the code, so I'm happy with this change (with the comment fixed).
I believe the idea was that using an array would put the value into a register, hopefully speeding up the comparisons.
I also tried a version of this patch that read scan_start and scan_end into u64 to try to encourage the compiler to use registers, but this version outperformed it. |
Sorry about the extraneous merge commit. I clicked the button on github that I thought would rebase, and it generated a merge commit instead. |
f608ce4
to
2603ea9
Compare
nothing some git-foo can't fix :) I'm not sure why github does that. Anyway, if there is no conflict, there is no need to have github update that branch, and when there are conflicts, in practice I end up just resolving the locally with full editor support etc instead of on github where it is so easy to e.g. mess up formatting. |
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 think this change is ok, but this is a rather non-trivial function that I'm not all that familiar with.