linux-gcc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* strcmp is too heavy for its everyday usage...
@ 2004-01-08  1:09 Denis Zaitsev
  2004-01-08  1:13 ` Roland McGrath
  0 siblings, 1 reply; 8+ messages in thread
From: Denis Zaitsev @ 2004-01-08  1:09 UTC (permalink / raw)
  To: Zack Weinberg, Andreas Jaeger, Richard Henderson; +Cc: libc-alpha, linux-gcc

strcmp is _mostly_ used here and there to check strings for equality
only, not for finding their ordering.  And if we have a function for
this equality check only, it would be a reasonable benefit:

a) for a long strings this function can operate with a whole
   words vs. bytes, which is much faster;

b) for a very short strings, when strcmp and this function can be
   unrolled into a series of a direct bytes comparing, this defun
   don't have to cope with (unsigned char) -> (int) casting for the
   each pair of bytes, so it will be shorter, faster etc.

memcmp is the subject of the question, too.

Any comments?

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-01-14  5:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-08  1:09 strcmp is too heavy for its everyday usage Denis Zaitsev
2004-01-08  1:13 ` Roland McGrath
2004-01-08  1:36   ` Denis Zaitsev
2004-01-08  9:30     ` Andreas Schwab
2004-01-09  5:11       ` Denis Zaitsev
2004-01-09  8:12         ` Richard Henderson
2004-01-09  8:49           ` Denis Zaitsev
2004-01-14  5:09           ` James Antill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).