comp.lang.ada
 help / color / mirror / Atom feed
From: "Alinabi" <alexander.the.average@gmail.com>
Subject: Re: GNAT compiler switches and optimization
Date: 22 Oct 2006 06:50:13 -0700
Date: 2006-10-22T06:50:13-07:00	[thread overview]
Message-ID: <1161525012.997046.264780@k70g2000cwa.googlegroups.com> (raw)
In-Reply-To: <sj3r04-rlv.ln1@newserver.thecreems.com>

I ran your test programs compiled with gcc 4.0.3 and the following
optimizations:
COMMON_FLAGS=-g -march=opteron -mtune=opteron -mfpmath=sse
-fomit-frame-pointer -O2 -fdump-tree-optimized
and I cannot reproduce the large differences in performance everyone
else talks about. Here are the times I get:

N        Ada            Fortran
====================
64      0.002029   0.000000
128    0.016321   0.016000
256    0.214143   0.204013
512    3.125888   3.124195
800    6.374982   5.864366
1024  34.10479   35.22620
2048  277.3071   283.2417

Jeffrey Creem wrote:
> Jeffrey Creem wrote:
> > Pascal Obry wrote:
> >
> >> 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.
> >>
> >
> > Actually, the original poster's Ada program had the temp var and all of
> > my comparisons of programs that I have asserted were "the same" used the
> > temporary.
> >
> > As for Long_Float v.s. Short_Float, gfortran is using 32 bit floats (as
> > verified by dumping the tree representation and assembly language).
> >
> > Since we are all getting a bit confused by specific versions and numbers
> > I thought I'd post a summary and create a way of tracking more global
> > performance issues at the gnuada.sf.net wiki.
> >
> > The direct link to these test results are here:
> >
> > http://gnuada.sourceforge.net/pmwiki.php/Main/Oct2006CLAGFORTRANComparison
> >
> >
> >
>
>
>
> Actually, as a result of this, I submitted a bug report to the GCC
> bugzilla list. You can follow progress on it here:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29543
>
> Interesting initial feedback is that
> 1) Not an Ada bug.
> 2) Is a FORTRAN bug
> 3) Is a backend limitation of the optimizer.
>
> Of course, the FORTRAN one still runs correctly so I don't think most
> users will care that it is because of a bug :)




  parent reply	other threads:[~2006-10-22 13:50 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-20 10:47 GNAT compiler switches and optimization tkrauss
2006-10-20 11:04 ` Duncan Sands
2006-10-21 10:45   ` Stephen Leake
2006-10-20 11:42 ` Duncan Sands
2006-10-20 15:41   ` Martin Krischik
2006-10-20 12:09 ` Samuel Tardieu
2006-10-20 12:18   ` Samuel Tardieu
2006-10-20 12:12 ` Gautier
2006-10-20 12:35 ` Dmitry A. Kazakov
2006-10-20 15:53   ` Martin Krischik
2006-10-20 12:52 ` Gautier
2006-10-20 13:27 ` claude.simon
2006-10-20 15:38 ` Robert A Duff
2006-10-20 19:32   ` Gautier
2006-10-20 15:56 ` Jeffrey Creem
2006-10-20 16:30 ` Martin Krischik
2006-10-20 19:51 ` Gautier
2006-10-20 22:11 ` Jeffrey R. Carter
2006-10-20 23:52   ` Jeffrey Creem
2006-10-21  7:37     ` Gautier
2006-10-21 16:35       ` Jeffrey Creem
2006-10-21 17:04         ` Pascal Obry
2006-10-21 21:22           ` Jeffrey Creem
2006-10-22  3:03             ` Jeffrey Creem
2006-10-22  7:39               ` Jeffrey R. Carter
2006-10-22 11:48                 ` tkrauss
2006-10-22 18:02                   ` Georg Bauhaus
2006-10-22 18:24                     ` Jeffrey Creem
2006-10-23  0:10                       ` Georg Bauhaus
2006-10-22 20:20                   ` Jeffrey R. Carter
2006-10-22 12:31                 ` Gautier
2006-10-22 20:26                   ` Jeffrey R. Carter
2006-10-22 21:22                     ` Gautier
2006-10-22 18:01                 ` tmoran
2006-10-22 20:54                   ` Jeffrey R. Carter
2006-10-22 13:50               ` Alinabi [this message]
2006-10-22 15:41                 ` Jeffrey Creem
2006-10-23  0:02                   ` Alinabi
2006-10-23  5:28                     ` Gautier
2006-10-23 16:32                       ` Alinabi
2006-10-22 15:57               ` Jeffrey Creem
2006-10-22 19:32                 ` Damien Carbonne
2006-10-22 20:00                   ` Gautier
2006-10-22 20:51                     ` Damien Carbonne
2006-10-23  2:15                       ` Jeffrey Creem
2006-10-23  2:29                         ` Jeffrey R. Carter
2006-10-23  1:31                   ` Jeffrey Creem
2006-10-23  3:10                     ` Jeffrey Creem
2006-10-23  7:31                       ` Jeffrey R. Carter
2006-10-23 11:55                         ` Jeffrey Creem
2006-10-23 19:52                           ` Wiljan Derks
2006-10-23 20:25                             ` Jeffrey R. Carter
2006-10-24  9:52                             ` Dr. Adrian Wrigley
2006-10-24 11:50                               ` Jeffrey Creem
2006-10-24 16:24                                 ` Jeffrey R. Carter
2006-10-25  3:50                                   ` Jeffrey Creem
2006-10-25 15:32                                     ` claude.simon
2006-10-24 19:21                               ` Wiljan Derks
2006-10-23 12:33                   ` Warner BRUNS
2006-10-23 12:40                   ` Warner BRUNS
2006-10-23 13:52                     ` Georg Bauhaus
2006-10-23 17:11                       ` Warner BRUNS
2006-10-23 17:57                         ` Dr. Adrian Wrigley
2006-10-23 15:02                     ` Robert A Duff
2006-10-23 20:22                       ` Jeffrey R. Carter
2006-10-21 18:28         ` tmoran
2006-10-23  6:28       ` Martin Krischik
2006-10-21 12:39 ` Dr. Adrian Wrigley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox