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

Inline Index and IndexMut implementations #79

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

Conversation

valadaptive
Copy link
Contributor

@valadaptive valadaptive commented Dec 19, 2024

I ran into this when optimizing simdnoise. With gather ops no longer being a thing, I reimplemented them as standard loops. This led to a 20-30% slowdown in my application (which spends around half its time in simdnoise, so simdnoise itself is about 40-60% slower).

I thought the software gather ops were just inherently slower, but the actual problem is this line, with the innocuous-looking indices[i] access. i ranges from 0 to WIDTH, so the compiler should be able to easily remove the bounds check, but it couldn't, because the indexing operations couldn't be inlined.

With that fixed, simdnoise should now be as fast as it used to be before updating to simdeez 2.

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