home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
usenet
/
altsrcs
/
1
/
1885
< prev
next >
Wrap
Internet Message Format
|
1990-12-28
|
937b
From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr)
Newsgroups: alt.sources
Subject: Re: Fast strcmp() wanted.
Message-ID: <1966@sixhub.UUCP>
Date: 29 Sep 90 20:55:31 GMT
In article <1990Sep27.151543.8025@ccs.carleton.ca> dfs@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@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