I am reading \"Write Great Code Volume 2\" and it shows the following strlen impelementation:
int myStrlen( char *s )
{
char *start;
start = s;
w
Reading a variable that is not of the same size as the machine data bus size is expensive, because the machine can only read variables of that size. Therefore, whenever something of different size (let's say smaller) is requested, the machine must do work to make it look like a variable of the requested size (like shifting the bits). So you better read the data in machine sized words, and then use the AND operation to check for 0s. Also, when scanning through the string, make sure you start at an aligned start address.