From: "Arash Salarian" Newsgroups: comp.os.msdos.djgpp,comp.lang.c++ References: <3CFCB642 DOT 252CFFF7 AT bigfoot DOT com> Subject: Re: Optimization and operator&& Date: Tue, 4 Jun 2002 17:22:05 +0200 Lines: 39 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 NNTP-Posting-Host: metpc38.epfl.ch Message-ID: <3cfcdb4a$1@epflnews.epfl.ch> X-Trace: epflnews.epfl.ch 1023204170 metpc38.epfl.ch (4 Jun 2002 17:22:50 +0200) Organization: EPFL 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? > > P.S Elapsed time of operator+ decreases. > > Thanks in advance. > > ..... > Your solution of using systems "very low resolution" timer (which has actually only a 55msec resolution) combined with very low iteration of the main loop (only 1000 times) is the cause of this result. Try to re-write your code with much higher iteration (more than 1 million at least) so that the total execution time of the program becomes much much more in comparison to 55msec resolution of the timer..... hmmmmmm, but as I see, all this seems to be quite off topic here which is Standard C++ language..... Regards Arash