Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!xylogics!transfer!lectroid!bigbootay!dswartz From: dswartz@bigbootay.sw.stratus.com (Dan Swartzendruber) Newsgroups: comp.arch Subject: Re: Re: a style question Message-ID: <2580@lectroid.sw.stratus.com> Date: 3 Oct 90 19:48:07 GMT References: <1990Oct2.151644.1581@phri.nyu.edu> <1300002@hp-ptp.HP.COM> <2572@lectroid.sw.stratus.com> <41898@mips.mips.COM> Sender: usenet@lectroid.sw.stratus.com Reply-To: dswartz@bigbootay.sw.stratus.com (Dan Swartzendruber) Organization: Stratus Computer, Software Engineering. Lines: 30 In article <41898@mips.mips.COM> mash@mips.COM (John Mashey) writes: :In article <2572@lectroid.sw.stratus.com> dswartz@bigbootay.sw.stratus.com (Dan Swartzendruber) writes: ::Can you say "nitpicking over whether to do == or < is silly micro-level ::optimization which can't even be relied on to behave the same from one ::machine to the next"? I knew you could! : :At the code level, this is probably true, although it certainly is the :case that there are fundamental computer system design reasons why :== might be faster than <. Whether these reasons show up in any :given computer architecture is another issue, but certainly, if you care, :the == or != tests are likely to be equal or faster on many machines, :or equal on others, but seldom slower. :It probably doesn't matter most places, except in some technical code :with short loops with many iterations. My point was only that I felt that any performance advantage (one or two clocks was bandied about) is grossly outweighed by the rest of the loop, and given that, I tend to prefer the < syntax (since it is pretty much required for floating-point variables.) :-- :-john mashey DISCLAIMER: :UUCP: mash@mips.com OR {ames,decwrl,prls,pyramid}!mips!mash :DDD: 408-524-7015, 524-8253 or (main number) 408-720-1700 :USPS: MIPS Computer Systems, 930 E. Arques, Sunnyvale, CA 94086 -- Dan S.