Path: utzoo!attcan!uunet!know!cs.utexas.edu!rutgers!att!dptg!ulysses!andante!alice!ark From: ark@alice.att.com (Andrew Koenig) Newsgroups: comp.lang.c Subject: Re: Comparing strings... (long but maybe worth it) Message-ID: <11488@alice.att.com> Date: 14 Oct 90 14:26:17 GMT References: <2205.271700c2@cc.nu.oz.au> <11485@alice.att.com> <1990Oct14.095336.2819@zoo.toronto.edu> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 24 In article <1990Oct14.095336.2819@zoo.toronto.edu>, henry@zoo.toronto.edu (Henry Spencer) writes: > Some (for example, me) would say that this was aided by your reliance on > implicit comparisons to zero, which hurt readability and do nothing for > your stated goal of greater efficiency. Why did you bother doing that? Because for me it increases readability. > >I imagine that further optimizations are possible... > Definitely. ... > [optimization description deleted] Neat! And you haven't even unrolled any loops! > For extra credit, discuss how current implementations by > both Berkeley and AT&T attempt this optimization and thereby introduce > a bug (hint: consider the fact that char is signed on most machines). I'm afraid I may have given it away in another posting, which I made before I saw this one. -- --Andrew Koenig ark@europa.att.com