home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
usenet
/
altsrcs
/
1
/
1900
< prev
next >
Wrap
Internet Message Format
|
1990-12-28
|
889b
From: markh@csd4.csd.uwm.edu (Mark William Hopkins)
Newsgroups: alt.sources
Subject: Re: Fast strcmp() wanted.
Message-ID: <6757@uwm.edu>
Date: 4 Oct 90 06:01:08 GMT
In article <12145@crdgw1.crd.ge.com> larocque@jupiter.crd.ge.com (David M. LaRocque) writes:
>After I profiled my C program I discovered that the function
>strcmp() takes one third of my program's CPU time. I was hoping
>someone may have written their own version of strcmp() that
>outperforms the library's function.
Look at some references on the architecture of the machine your system is
running on. It will most likely have hardware-implemented string instructions
that you can use.
On our machine, the strcmp library routine is really nothing more than a single
assembly-language instruction with a couple register-initializations. It will
almost certainly run far faster than any equivalent high-level source.