From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-11 03:15:44 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.teledanmark.no!news.equant.no!uninett.no!dax.net!juliett.dax.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X References: From: Ole-Hjalmar Kristensen Message-ID: <7v8ys83opd.fsf@vlinux.voxelvision.no> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 11 Jun 2003 10:15:11 GMT NNTP-Posting-Host: 193.216.12.150 X-Complaints-To: abuse@tele2.no X-Trace: juliett.dax.net 1055326511 193.216.12.150 (Wed, 11 Jun 2003 12:15:11 MET DST) NNTP-Posting-Date: Wed, 11 Jun 2003 12:15:11 MET DST Organization: Tele2 Norway AS Public Access Xref: archiver1.google.com comp.lang.ada:38964 Date: 2003-06-11T10:15:11+00:00 List-Id: tmoran@acm.org writes: > Hyman Rosen said: > > > how fast do they execute 10**7 times on 3x3 matrices of zeros? > > for (i = 0; i < 100000000; ++i) A = A + B; > >Program output (times are in seconds): > >+ 8 > >+= 5 > > That's for 10**8, so 0.8 and 0.5 are the numbers for 10**7, right? > Those numbers are notably faster than your earlier 1.1, 0.7 - is it the > same machine, different compiler, or different machine, or improved > code, or what? > > Ole Kristensen said: > > Same compiler, old 266MHz PII: > > + 24 > > += 10 > I assume that's also for 10**8 iterations, so 2.4 and 1.0 are the 1E7 > numbers? If that machine is 1/3 the speed of an 866MHz PIII, that > suggests the compiler makes a big difference (or perhaps the compiler's > optimizations). Yes, it was the code posted together with Hyman's results, so it's 10**8 iterations. Here are the results from my machine at work, 10**8 iterations: $ g++ -O3 -funroll-loops -o hyman hyman.cpp oleh@VOLGA /cygdrive/c/div $ time hyman + 3 += 2 real 0m5.606s user 0m5.477s sys 0m0.020s > > Returning to the original point, about the relative speed of + with > a (presumed) temporary vs +=, we seem to have a range of ratios > of 1.3 .. 2.9, with 1.6 being a commonly occurring value. -- Ole-Hj. Kristensen ****************************************************************************** * You cannot consistently believe this sentence. ******************************************************************************