Skip to content

c: use AVX and SSE to bulk scan#1

Open
rmg wants to merge 1 commit intomasterfrom
fun-with-avx
Open

c: use AVX and SSE to bulk scan#1
rmg wants to merge 1 commit intomasterfrom
fun-with-avx

Conversation

@rmg
Copy link
Copy Markdown
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