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,cd703a96ca51de6e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!wns13feed!worldnet.att.net!204.71.34.3!newsfeed.cwix.com!newsfeed.gamma.ru!Gamma.RU!npeer.de.kpn-eurorings.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.astraweb.com!newsrouter-eu.astraweb.com!hwmnpeer01.ams!hw-filter.ams!newsfe10.ams.POSTED!40385e62!not-for-mail From: Per Sandberg 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: 'Base References: <1134055303.758950.308680@o13g2000cwo.googlegroups.com> <2038690.eAzdaEvAON@linux1.krischik.com> <1134160956.403383.29180@z14g2000cwz.googlegroups.com> <1170126.PvJVGQkA4J@linux1.krischik.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@WWWSpace.NET NNTP-Posting-Date: Wed, 14 Dec 2005 12:43:03 MST Organization: @WWWSpace UseNET Date: Wed, 14 Dec 2005 20:43:35 +0100 Xref: g2news1.google.com comp.lang.ada:6880 Date: 2005-12-14T20:43:35+01:00 List-Id: Ole-Hjalmar Kristensen wrote: > My gut reaction was also that Ada will always outperform Java, but I > have found at least one case there this is not true. I recently wrote > a simple test program to transpose a two-dimensional array in Java, > Ada, C++, and C. The purpose was not really to compare languages, but > to see the effects of caching. There were two different alogrithms > used, one a simple nested loop, the other a recursive subdivision with > a nested loop at the lowest level. When the simple nested loop was > tested with large data sets (~ available RAM on the machines) the > diffence between Ada, C, and C++ was insignificant, all being 3-4 > times faster than Java. However, when testing the recursive version, I > found that Java was actually about 10% faster than the other three, > which again came extremely close to each other. Apparently the JIT > compiler had plenty of time to do its work and come up with pretty > optimal code. The other interesting result from the experiment was > that the recursive version was from 3-4 to 20 times faster than the > simple nested loop. > > > >>>>>>"MK" == Martin Krischik writes: > > > MK> Ada arrays are not a primitive type - they are a quite complex and powerfull > MK> type. > > MK> Performace? Ada allways outperform Java for a start. But Ada's build in > MK> checks will also outperform C/C++ when used with all appropriate > MK> "assert()"s in place. > > This is intresting but i have tried Ada (GNAT/GCC) with different optimisation levels and different validity checking. and fount that ther is a clearly visible diference in performance depending on how far the compiler is allowed to go in terms of optimisation. I have not done any qualified measurments but the guts feeling is that the performace may change bye a factor of at least 2 depending on compiler switches. Also worth to mention that as far as i have seen ther is normaly areound 30% difference in performace when going from "-O0" to "-Os". /Per