[PATCH] Use strlen when searching for a nul char
Andreas Schwab
schwab@suse.de
Wed Oct 7 15:30:00 GMT 2015
Joseph Myers <joseph@codesourcery.com> writes:
> (And please accompany performance claims such as "faster on most targets"
> with figures from the benchtests or a reason it's hard to produce such
> figures. In this case I think the transformation could be justified for
> GCC as something architecture-independent without specific performance
> claims - strlen being inherently simpler because it only ever has to
> search for 0 bytes, so it should never be asymptotically slower than the
> alternative and may be faster.)
On the debit side you have to keep the value of the pointer around in
order to add it afterwards.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list