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,8c8550b9f2cf7d40 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-10 12:47:37 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.e.nsc.no!nsc.no!nextra.com!news2.e.nsc.no.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Is ther any sense in *= and matrices? References: From: Ole Kristensen Message-ID: Organization: Linux Private Site User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 148.122.128.188 X-Complaints-To: news-abuse@telenor.net NNTP-Posting-Date: Tue, 10 Jun 2003 21:47:37 MEST X-Trace: news2.ulv.nextra.no 1055274457 148.122.128.188 Date: 10 Jun 2003 21:48:47 +0200 Xref: archiver1.google.com comp.lang.ada:38932 Date: 2003-06-10T21:48:47+02:00 List-Id: tmoran@acm.org writes: > To summarize some of the benchmarks of A=A+B vs A+=B, 3x3 matrices, 10**7 iterations > A=A+B A+=B ratio > 55 19 2.9 Russ's special code on Sunblade, slightly faster than > an 866MHz Pentium III according to > http://www.phys.ocean.dal.ca/~kelley/linux/benchmark/benchmark_POM.html > 4.4 3.3 1.3 MSVC++5.0 simple code on Tom's 866MHz Pentium III > 1.4 0.8 1.6 Gnat 3.15p on Tom's 866MHz Pentium III > 1.1 0.7 1.6 g++.5.8 (GCC) 3.2.2 using C templates on Hyman's "Sun workstation", speed unspecified > 0.45 0.18 2.5 Ole-Hjalmar's machine ? gcc Ada or C the same? Another data point: My old home PC, a 266MHz pentium II, compiler g++ 3.2, Tom's simple C++ code: ole@linux:~> time ./tmoran Go 1000000 4460000 6320000 real 0m13.626s user 0m10.800s sys 0m0.000s If I read the results correctly, it actually beats the SunBlade 2000, which it definitely should not do. But there is much less of a difference between + and += on this machine than on the fast machine at work. Maybe I should check the g++ version on my machine at work once more. Turning optimization off produces even less difference: ole@linux:~> g++ -o tmoran tmoran.cc ole@linux:~> !time time ./tmoran Go 1000000 12850000 14120000 real 0m34.219s user 0m26.950s sys 0m0.040s Ole-Hj. Kristensen