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-Thread: 103376,7767a311e01e1cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!news2.volia.net!news.ecp.fr!news.in2p3.fr!in2p3.fr!proxad.net!193.252.118.146.MISMATCH!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Message-ID: <453A532F.2070709@obry.net> Date: Sat, 21 Oct 2006 19:04:47 +0200 From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 Newsgroups: comp.lang.ada To: Jeffrey Creem Subject: Re: GNAT compiler switches and optimization References: <1161341264.471057.252750@h48g2000cwc.googlegroups.com> <9Qb_g.111857$aJ.65708@attbi_s21> <434o04-7g7.ln1@newserver.thecreems.com> <4539ce34$1_2@news.bluewin.ch> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 21 Oct 2006 19:04:51 CEST NNTP-Posting-Host: 82.120.16.202 X-Trace: 1161450291 news.orange.fr 25940 82.120.16.202:4639 X-Complaints-To: abuse@orange.fr Xref: g2news2.google.com comp.lang.ada:7117 Date: 2006-10-21T19:04:51+02:00 List-Id: Jeffrey Creem a �crit : > I'd certainly be willing to run a few benchmarks but the important thing > here is that rather innocent looking code is running 2-4x slower than it > "should". The first thing is to be sure that we are running the same program. Running your program with the following changes (as done in Fortran): 1. Using Sum tmp var for the computation for I in A'range (1) loop for J in A'range (2) loop Sum := 0.0; for R in A'range (2) loop Sum := Sum + A (I, R) * B (R, J); end loop; C (I, J) := Sum; end loop; end loop; 2. Using Long_Float instead of Float (I think Fortran float is a Long_Float, to be checked). I went from 7.8s to 4.8s (with 1) and to 4.2s (with 2). Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595