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

rewriting strcasechr to compare multiple bytes at once #174

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

Conversation

333-9
Copy link

@333-9 333-9 commented Jun 12, 2022

Doing some basic pointer/bit magic to compare 4 bytes for a requested character.

The code compares 4 bytes at a time, since this is faster than comparing 8 bytes
when the target character is in the first 32 bytes (on average).
But the most significant speedup is probably a call to strchr when the requested
character is a utf-8 byte (may be extended to all non-alphabetical characters).

@vaygr vaygr mentioned this pull request Jul 19, 2022
6 tasks
vigoux added a commit to vigoux/azy.nvim that referenced this pull request Sep 18, 2022
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.

None yet

1 participant