This is the mail archive of the libc-help@sourceware.org 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


Hi,
may be a stupid question but reading the source code of
string/strcmp.c I wonder why not using word comparaisons rather than
byte to byte comparaisons.
We could also use the same "magic" as in strlen to detect '\0'.
I am just surprised that the current code realizes not less than 17
comparaisons for two 8 character strings for example... as it seems
rapidely it could be reduce to just one long word (64 bits)
comparison.


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