Re: strcmp is too heavy for its everyday usage...

Andreas Schwab <[email protected]> Thu, 08 Jan 2004 10:30:04 +0100
Newsgroups org.kernel.vger.linux-gcc
Message-ID <[email protected]>
Denis Zaitsev <[email protected]> writes:

> On Wed, Jan 07, 2004 at 05:13:11PM -0800, Roland McGrath wrote:
>
>> The optimized string functions already do word comparisons when that
>> is possible and advantageous.  The comparisons to extract the
>> ordering vs just equality/nonequality are only on the first
>> nonmatching byte.
>
> But it's an overhead anyway.

Rather neglectable, IMHO.

> Then, it's bad enough for the inlining.

If it's inlined then the compiler should be smart enough to discard the
unneded bits.  If not, and the difference is measurable, then the compiler
should be fixed.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."