Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: Efficient STRing CoMPares?
Message-ID: <1991Mar20.175106.4595@zoo.toronto.edu>
Date: Wed, 20 Mar 1991 17:51:06 GMT
References: <1991Mar15.142821@mars.mpr.ca> <1991Mar16.211154.5568@cc.helsinki.fi>
Organization: U of Toronto Zoology

In article <1991Mar16.211154.5568@cc.helsinki.fi> wirzenius@cc.helsinki.fi (Lars Wirzenius) writes:
>For non-portability, the fastest way would probably be to write inline
>assembly code using the machine's string compare instruction...

Actually, not necessarily so.  Even on machines which have a string-compare
instruction, that instruction is often relatively slow.  It can be quicker
to do it yourself.

There are also some fiendish tricks that can be played to considerably beat
the performance of the obvious compare loop, and of any string-compare
instruction which basically just implements that loop.  However, you'll
have to wait a bit longer to hear about them, since the summer Usenix
conference rejected my paper...
-- 
"[Some people] positively *wish* to     | Henry Spencer @ U of Toronto Zoology
believe ill of the modern world."-R.Peto|  henry@zoo.toronto.edu  utzoo!henry
