Path: utzoo!utgpu!cs.utexas.edu!uwm.edu!csd4.csd.uwm.edu!markh 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 References: <12145@crdgw1.crd.ge.com> Sender: news@uwm.edu Reply-To: markh@csd4.csd.uwm.edu (Mark William Hopkins) Organization: University of Wisconsin-Milwaukee Lines: 13 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.