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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4b12a5cee4778f63 X-Google-Attributes: gid103376,public From: Geoff Bull Subject: Re: GNAT & GCC performace (bad news) Date: 1999/12/03 Message-ID: <38473D90.68D8F47@acenet.com.au>#1/1 X-Deja-AN: 556062188 Content-Transfer-Encoding: 7bit References: X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@telstra.net X-Trace: nsw.nnrp.telstra.net 944192896 203.35.118.1 (Fri, 03 Dec 1999 14:48:16 EST) Organization: Customer of Telstra Big Pond Direct MIME-Version: 1.0 NNTP-Posting-Date: Fri, 03 Dec 1999 14:48:16 EST Newsgroups: comp.lang.ada Date: 1999-12-03T00:00:00+00:00 List-Id: Harald Schmidt wrote: What I was expecting, > because gnat isn't a compiler env. but a to-C(++) translator, > the performance decrease about ten to twenty percent but > not 50 percent. Gnat is a true compiler. It does not translate to-C(++). My experience is that, for equivalent code, Gnat produces code that is as fast or slightly faster than C. This is not surprising when one considers that Gnat and the Gnu C compiler share the *same* backend code generator. OTOH, my first Gnat program was about 100 times slower than the C I had translated. Once I understood why (the C was buffering its IO, the Ada was not) and made a few changes, the Ada version was a few percentage points faster. I suggest you look at your benchmarks to make sure they are really equivalent. Also, did you compile both with the same levels of optimisation and turn off Ada's run time checks (in my experience, the latter doesn't usually make an enormous difference, but it is worth a try)? __ Geoff