Fast strcmp() wanted.
Wm E. Davidsen Jr
davidsen at sixhub.UUCP
Sun Sep 30 06:55:31 AEST 1990
In article <1990Sep27.151543.8025 at ccs.carleton.ca> dfs at doe.carleton.ca (David F. Skoll) writes:
| Hmm... that seems strange. If the first characters of the strings differ,
| most strcmps will not bother to test the rest. All that the above code
| possibly saves you is a function call/return. If this makes such a huge
| difference, then the compiler or your machine's architecture must be pretty
| bad.
If the test of the first character saves a procedure call, then no
matter how good the compiler is it will be faster not to do the call.
--
bill davidsen - davidsen at sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
sysop *IX BBS and Public Access UNIX
moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me
More information about the Alt.sources
mailing list