This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Denis Zaitsev <zzz@anda.ru> 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, schwab@suse.de
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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]