Skip to content

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 :)

@mateoconlechuga mateoconlechuga merged commit 4af9686 into master May 6, 2025
9 checks passed
@mateoconlechuga mateoconlechuga deleted the pr/strcmp_opt branch May 6, 2025 19:38
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