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!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!news.compaq.com!newsfeed1.sea.pnap.net!newsfeed2.sea.pnap.net!newsfeed.pnap.net!brmea-news-1.sun.com!news1brm.central.sun.com!new-usenet.uk.sun.com!not-for-mail From: Ole-Hjalmar Kristensen Newsgroups: comp.lang.ada Subject: Re: 'Base Date: 12 Dec 2005 10:14:38 +0100 Organization: Sun Microsystems Message-ID: References: <1134055303.758950.308680@o13g2000cwo.googlegroups.com> <2038690.eAzdaEvAON@linux1.krischik.com> <1134160956.403383.29180@z14g2000cwz.googlegroups.com> <1170126.PvJVGQkA4J@linux1.krischik.com> NNTP-Posting-Host: khepri06.norway.sun.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: new-usenet.uk.sun.com 1134379170 1310 129.159.112.195 (12 Dec 2005 09:19:30 GMT) X-Complaints-To: usenet@new-usenet.uk.sun.com NNTP-Posting-Date: 12 Dec 2005 09:19:30 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:6845 Date: 2005-12-12T09:19:30+00:00 List-Id: 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. -- C++: The power, elegance and simplicity of a hand grenade.