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, MSGID_RANDY 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: Robert Dewar Subject: Re: GNAT & GCC performace (bad news) Date: 1999/12/03 Message-ID: <828lra$7lr$1@nnrp1.deja.com>#1/1 X-Deja-AN: 555989760 References: X-Http-Proxy: 1.0 x22.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Dec 03 14:58:52 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-12-03T00:00:00+00:00 List-Id: In article , Harald Schmidt wrote: > What I was expecting, > because gnat isn't a compiler env. but a to-C(++) translator No, that's completely wrong, GNAT has nothing to do with C or C++, it is a compiler structured in the traditional manner. Front end converts to intermediate code Code generator generates code from intermediate code What may confuse you is that gcc is a multi-language compiler and also provides C and C++ front ends which compile into the same intermediate code. > the performance decrease about ten to twenty percent but > not 50 percent. You always have to remember that you are NOT compiling the same code. One set of code is in C and the other in Ada. As always performance is a strong factor not only of the machine and compiler, but also how the code is written. Basically what your results show is that the Ada code is written in a manner that runs twice as slow as the C code. That does not necessarily mean that the Ada code is bad, since often we take advantage of Ada's high level features to make the code clearer, but there can be an efficiency cost associated with this. The test you refer to is only valid, to the extent that it is valid at all, for comparing one Ada compiler to another, or one C compiler to another, but the Ada vs C is apples vs oranges since you are comparing two different programs. It is certainly possible to write an Ada program that will perform comparably with the C program (in fact if you are comparing GNAT and GNU C, it is usually possible to get the Ada program to output identical binary text for the program. Robert Dewar Ada Core Technologies Sent via Deja.com http://www.deja.com/ Before you buy.