HEADS DOWN

Andrey Chernov ache at freebsd.org
Tue May 8 22:25:41 UTC 2007


On Tue, May 08, 2007 at 04:37:03PM -0500, Sean C. Farley wrote:
>  Would it be preferred to go ahead to use strlen() in preparation for a
>  faster strlen() in the future?  

IMHO with this note from Bruce
"Of course, optimizing strlen() is unimportant, since even the slowest
method runs at nearly 1GB/S on modern machines and you rarely have
more than a few MB of strings to process."

and this one from Kostik
"gcc 4.3 claims to not issue cld instruction anymore (ABI requires direction
flag to be clear since eon)."

we can use strlen() in preparation for the future.

>  I would still use the inline'd version
>  when counting characters while watching for an '=' character.  Or should
>  it also be changed to perform a strlen() and then a strchr()?

Combined strlen()+strchr() will be slower in any case than single loop, so 
better leave it as is.

-- 
http://ache.pp.ru/


More information about the freebsd-arch mailing list