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-7-bit Path: g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 22 Oct 2006 11:00:18 -0500 Date: Sun, 22 Oct 2006 11:57:16 -0400 From: Jeffrey Creem User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada 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> <453A532F.2070709@obry.net> <9kfq04-sgm.ln1@newserver.thecreems.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <5vgs04-64f.ln1@newserver.thecreems.com> NNTP-Posting-Host: 24.147.74.171 X-Trace: sv3-VmUvogjBqbMioSxLzjWQxrP6gBDcez4S1Q5o7XQ5RBKgYS6hz93fz4uWUjG/EQmKYJXmTtr4kaoZnQE!vV15G6qj6yxl+49KkfQuqLCc8fWxgG4MwGcodVhUWjz6vHMHSnrv2QxA6VvhqFbNtWRMFYt/S80+!/Qw= X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:7134 Date: 2006-10-22T11:57:16-04:00 List-Id: Followup on the bug report. One of the comments asserted that the two programs were not equivilent though I am not yet 100% convinced that I believe it yet. His recommendation was to remove a level of indirection by changing the way the array is declared. N : Positive := Positive'Value (Argument (1)); G : Ada.Numerics.Float_Random.Generator; type Real_Matrix is array (1..N, 1..N) of Float; type Matrix_Access is access Real_Matrix; A,B,C : Matrix_Access; Start, Finish : Ada.Calendar.Time; Sum : Float := 0.0; begin A := new Real_Matrix; B := new Real_Matrix; C := new Real_Matrix; This does indeed substantially improve the performance (still not quite to FORTRAN levels). The reason I question the equilivence is that in the original version, the array could have been passed to a procedure that took in an unconstrained array (which is pretty much what I think the FORTRAN version would allow) while this new version would not do that. A quick check shows the FORTRAN is now only 1.2 times faster (did not do the multiple run thing yet). Perhaps tonight. I'll also attempt to take one of the threaded ones and include that as well. Can someone that understands FORTRAN better make an argument about the "closeness" of this approach v.s. the other?