[–] kwillets 9y ago ↗ A few notes:1. memcmp is in <string.h>2. char is not the same as unsigned char3. Compilers like to remove loops. Notice how there are no labels, and no branches, in main here: https://godbolt.org/g/DCTBb7 .4. There are benchmarks of various methods: http://0x80.pl/articles/simd-strfind.html .
1 comment
[ 2.9 ms ] story [ 10.6 ms ] thread1. memcmp is in <string.h>
2. char is not the same as unsigned char
3. Compilers like to remove loops. Notice how there are no labels, and no branches, in main here: https://godbolt.org/g/DCTBb7 .
4. There are benchmarks of various methods: http://0x80.pl/articles/simd-strfind.html .