[Asterisk-Dev] FW: asterisk/doc CODING-GUIDELINES,1.4,1.5

Jerris, Michael MI mjerris at ofllc.com
Wed Jan 19 07:30:56 MST 2005


It would only terminate at the first call if the string were indeed zero
length, if it were not, it would have to cycle through to the end, so if
all you needed to know is if it is zero length, it is waisted cycles,
how much is really a different discussion, but rememeber that everything
multiplies in scale so what may be little issues with 10 users\calls
would be a totally diff issue with 1000 or more.  So the point of the
coding guidelines is more that we should write efficient code where it
is easy enough to implement (changing a function or macro around or
slightly different looping) but not too kill ourselves to the point of
just writing everything in assembler, at least as I read them.  
Mike

>But would strlen()'s loop not terminate on the first 0x00 char??  I
mean a couple dozen cycles here is not something a 
>user's gonna notice, even in a tight loop that is processing strings
for Asterisk.
>
>Personally I feel this whole ast_strlen_zero macro (it better be a
macro or at least inline function!) is poor optimization >-- does
Asterisk really spend so much time in strlen() that it was necessary?
>
>-A.




More information about the asterisk-dev mailing list