Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!haven!adm!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: Efficient STRing CoMPares? Message-ID: <14897:Mar2119:23:3591@kramden.acf.nyu.edu> Date: 21 Mar 91 19:23:35 GMT References: <15510@smoke.brl.mil> <1991Mar19.222410.1682@bingvaxu.cc.binghamton.edu> <1151@gistdev.gist.com> Organization: IR Lines: 12 In article <1151@gistdev.gist.com> flint@gistdev.gist.com (Flint Pellett) writes: > I'm curious if > anyone has a method that actually speeds up strcmp() in the situtation > where you have to get the lexicographic ordering information back. Unrolling the loop produces good results on many machines. You can also zoom through the strings comparing words, then compare characters if necessary (i.e., when your byte order is backwards) to produce a result. It works best if you know the string lengths beforehand and have each string starting on a word boundary. Piercarlo can explain a lot more. ---Dan