Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail |
|---|---|
| NNTP-Posting-Date | Wed, 14 Mar 2012 01:37:12 -0500 |
| From | Gareth Owen <gwowen@gmail.com> |
| Newsgroups | comp.lang.c |
| Subject | Re: More efficient strcmp |
| References | <jjog0d$rcc$1@speranza.aioe.org> <4F5FC802.70401@verizon.net> |
| Date | Wed, 14 Mar 2012 06:37:16 +0000 |
| Message-ID | <87d38fwuw3.fsf@gmail.com> (permalink) |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
| Cancel-Lock | sha1:zWwmgzP9K8BZkPJyM70Cmc9wxM0= |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Lines | 26 |
| X-Usenet-Provider | http://www.giganews.com |
| X-Trace | sv3-ZyQtpD2BFM1jDsepxZjRvhYhVqclM0+uvcj8Z7wUHUlHS/NtF4FomnCjt+a1uombKgkoU0t91Qz00VX!iUNnsnwn5BxnM+GLpYVeJAKdpUtDAW3ipBPxQQ7xxT/o07dJYT07NOOwL0UXSJx8nzU5Dw== |
| X-Abuse-and-DMCA-Info | Please be sure to forward a copy of ALL headers |
| X-Abuse-and-DMCA-Info | Otherwise we will be unable to process your complaint properly |
| X-Postfilter | 1.3.40 |
| X-Original-Bytes | 1659 |
| Xref | csiph.com comp.lang.c:18747 |
Show key headers only | View raw
James Kuyper <jameskuyper@verizon.net> writes:
> On 03/13/2012 05:59 PM, pembed2012 wrote:
>> Dear friends
>>
>> I have created a more efficient strcmp function. However it only works on
>> big endian architectures. I would like someone with same to run some
>> timing tests to see how much is the speed up.
>>
>> Thank you
>>
>> int strcmp_fast(char* s,char* t){
>> uls=(unsigned long*)s;
>> ult=(unsigned long*)t;
>> if(*uls>*ult) return(1);
>> if(*uls<*ult) return(-1);
>> else return(strcmp(s,t));
>> }
>
> char strings[0] = "a\0a\0b";
Typo:
char strings[] = "a\0a\0b"; // mutable
const char *strings = "a\0a\0b"; // immutable
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
More efficient strcmp pembed2012 <once@was.enough.invalid> - 2012-03-13 21:59 +0000
Re: More efficient strcmp Kleuske <kleuske@nowhere.net> - 2012-03-13 22:16 +0000
Re: More efficient strcmp "BartC" <bc@freeuk.com> - 2012-03-13 22:25 +0000
Re: More efficient strcmp Kleuske <kleuske@nowhere.net> - 2012-03-14 16:02 +0000
Re: More efficient strcmp James Kuyper <jameskuyper@verizon.net> - 2012-03-13 18:30 -0400
Re: More efficient strcmp Kaz Kylheku <kaz@kylheku.com> - 2012-03-13 23:05 +0000
Re: More efficient strcmp James Kuyper <jameskuyper@verizon.net> - 2012-03-13 18:19 -0400
Re: More efficient strcmp jacob navia <jacob@spamsink.net> - 2012-03-13 23:54 +0100
Re: More efficient strcmp Gareth Owen <gwowen@gmail.com> - 2012-03-14 06:37 +0000
Re: More efficient strcmp James Kuyper <jameskuyper@verizon.net> - 2012-03-14 07:32 -0400
Re: More efficient strcmp Stephen Sprunk <stephen@sprunk.org> - 2012-03-13 17:28 -0500
Re: More efficient strcmp Robert Wessel <robertwessel2@yahoo.com> - 2012-03-13 17:28 -0500
Re: More efficient strcmp Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-03-13 22:43 +0000
Re: More efficient strcmp "Joachim Schmitz" <nospam.jojo@schmitz-digital.de> - 2012-03-16 17:39 +0100
Re: More efficient strcmp Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-03-16 18:17 +0000
Re: More efficient strcmp Kaz Kylheku <kaz@kylheku.com> - 2012-03-13 23:03 +0000
Re: More efficient strcmp Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-14 15:55 +0100
Re: More efficient strcmp Kenneth Brody <kenbrody@spamcop.net> - 2012-03-14 14:19 -0400
Re: More efficient strcmp "BartC" <bc@freeuk.com> - 2012-03-13 23:25 +0000
Re: More efficient strcmp Bl0ckeduser <bl0ckedusersoft@gmail.com> - 2012-03-13 21:42 -0500
Re: More efficient strcmp Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-14 15:17 -0700
Re: More efficient strcmp Bl0ckeduser <bl0ckedusersoft@gmail.com> - 2012-03-14 19:06 -0400
Re: More efficient strcmp Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-15 18:53 -0700
Re: More efficient strcmp Andre <lodwig@pathme.de> - 2012-03-14 14:26 +0100
Re: More efficient strcmp China Blue Water Navy <chine.bleu@yahoo.com> - 2012-03-14 12:39 -0700
Re: More efficient strcmp vaysagekv <kvvaysage@gmail.com> - 2012-03-15 18:24 +0530
Re: More efficient strcmp gof@somewhere.invalid (Gof) - 2012-03-15 13:00 +0000
Re: More efficient strcmp "BartC" <bc@freeuk.com> - 2012-03-15 15:05 +0000
Re: More efficient strcmp Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-03-25 16:45 +0000
csiph-web