I am reading \"Write Great Code Volume 2\" and it shows the following strlen impelementation:
int myStrlen( char *s )
{
char *start;
start = s;
w
From Optimising strlen(), a blogpost by Colm MacCarthaigh:
Unfortunately in C, we’re doomed to an O(n) implementation, best case, but we’re still not done … we can do something about the very size of n.
It gives good example in what direction you can work to speed it up. And another quote from it
Sometimes going really really fast just makes you really really insane.