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

c: use AVX and SSE to bulk scan #1

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

c: use AVX and SSE to bulk scan #1

wants to merge 1 commit into from

Conversation

rmg
Copy link
Owner

@rmg rmg commented Aug 3, 2019

Use fancy instructions to scan 16, 32, and 64 byte ranges instead of
only inspecting a single byte at a time.

While this was a lot of fun to do, it turns out to not be as efficient
as being clever about avoiding comparisons whenever possible. That is,
reading only 1/20 bytes is better than reading 32 at once even if they are
the same number of instructions. This is because there is overhead in
loading the 128 and 256 bit registers and that overhead reduces the
gains enough to give us a net speed that is slightly slower.

Use fancy instructions to scan 16, 32, and 64 byte ranges instead of
only inspecting a single byte at a time.

While this was a lot of fun to do, it turns out to not be as efficient
as being clever about avoiding comparisons whenever possible. That is,
reading 1/10 bytes is better than reading 10 at once even if they are
the same number of instructions. This is because there is overhead in
loading the 128 and 256 bit registers and that overhead reduces the
gains enough to give us a net speed that is slightly slower.
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