From: "Heinz Ozwirk" Newsgroups: comp.os.msdos.djgpp,comp.lang.c++ Subject: Re: Optimization and operator&& Date: Tue, 4 Jun 2002 15:44:07 +0200 Organization: T-Online Lines: 38 Message-ID: References: <3CFCB642 DOT 252CFFF7 AT bigfoot DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1023198403 03 23597 2m36btwVSvAYrH 020604 13:46:43 X-Complaints-To: abuse AT t-online DOT com X-Sender: 320053623259-0001 AT t-dialin DOT net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Alex Vinokur" wrote in message news:3CFCB642 DOT 252CFFF7 AT bigfoot DOT com... > > ############### > Windows98 > gcc/gpp 2.95.3 > ############### > > > A program below measures performance (time) : > * of operator&& and operator+ > * with automatic and static unsigned int > * with optimizations : No optimization, O1, O2, O3 > > We can see that Optimization causes > an increase in elapsed time for operator&& . > Any explanation? ... > automatic, PLUS [1] Total time : 24 > automatic, PLUS [2] Total time : 24 > automatic, PLUS [3] Total time : 17 > automatic, PLUS [4] Total time : 18 > automatic, PLUS [5] Total time : 18 > automatic, PLUS [6] Total time : 17 > automatic, PLUS [7] Total time : 17 > automatic, PLUS [8] Total time : 18 > automatic, PLUS [9] Total time : 17 > automatic, PLUS [10] Total time : 18 ... Your results are useless. They differ by about 25%. Probably the resolution of your timer is too large (or your processor is too fast). Run your tests again, but this time measure at least 10,000,000 iterations. Regards Heinz