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]

strcmp is too heavy for its everyday usage...


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?


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