Why does glibc’s strlen need to be so complicated to run quickly?

I was looking through the strlen code here and I was wondering if the optimizations used in the code are really needed? For example, why wouldn’t something like the following work equally good or better? unsigned long strlen(char s[]) { unsigned long i; for (i = 0; s[i] != ‘\0’; i++) continue; return i; } … Read more