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,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada,comp.realtime,comp.software-eng Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: Wed, 9 Mar 2005 09:24:47 -0000 Organization: BAE SYSTEMS Message-ID: <422ebf29$1_1@baen1673807.greenlnk.net> References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <112rs0bdr2aftdf@corp.supernews.com> <1inxxr988rxgg$.1w9dedak41k89.dlg@40tude.net> <112s1r0rf0o8nca@corp.supernews.com> <112sonip5v4dca6@corp.supernews.com> <112t3de6fu04f38@corp.supernews.com> X-Trace: individual.net NP0P7e5vTk/cz1m2dNul8A4UBP9MDMiRz3I+WUNuSYH6+bwGKx X-Orig-Path: baen1673807.greenlnk.net!baen1673807!not-for-mail X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Original-NNTP-Posting-Host: baen1673807.greenlnk.net Xref: g2news1.google.com comp.lang.ada:8917 comp.realtime:1108 comp.software-eng:4668 Date: 2005-03-09T09:24:47+00:00 List-Id: Martin Dowie wrote: > CTips wrote: >> Actually, I can verify that: if I look at the computer shootout >> http://shootout.alioth.debian.org/great/, I find that gcc C beats >> gnat Ada pretty much across the board; actually, Ada's performance >> sucks pretty much across the board. One of gcc C or Intel C is >> generally among the top few programs, while with a couple of >> exceptions, Gnat Ada is around the middle. In matrix multiply it >> gets beaten by LISP, Java, and Python!!! (How can you get beaten by >> Python? The mind boggles!) > > It's very easy when you don't switch on _any_ optimizations! :-) > > GNAT is being compiled with the equivalent of "-O0" and GCC C is > getting "-O3". AdaCore (who maintain GNAT) have long claimed that equivilent Ada and C code will produce identical results and that they have such examples. The problem is in generating /equivilent/ programs to start with. E.g. in the matrix multiplication test, the writer of the Ada program has chosen to result arrays (by value!) from his functions, where as the C program uses pointer-to-pointer-to-int. A better idiom for the Ada version would have been to use a procedure with an 'out' parameter rather than functions. Cheers -- Martin