Skip to content

Optimized strcmp and strncmp. Also added memrchr #598

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

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

Conversation

ZERICO2005
Copy link
Contributor

Optimized strcmp and strncmp. Also added memrchr

strncmp has a linear speedup compared to Ti's routine (less clock cycles per character compared), making it much faster

strcmp has a constant speedup compared to Ti's routine (same clock cycles per character compared, but takes less clock cycles in total), which may be worth it when multiple short string comparisons need to be performed, such as when parsing text/scripts.

@mateoconlechuga
Copy link
Member

Please fix the tests :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants