delorie.com/archives/browse.cgi | search |
From: | "Arash Salarian" <arash DOT salarian AT epfl DOT ch> |
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" <alexvn AT bigfoot DOT com> 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |