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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,539c04254abf1b37 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-27 15:53:36 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: geb@rational.com (Gary Barnes) Newsgroups: comp.lang.ada Subject: Re: compiler benchmark comparisons (was: naval systems) Date: 27 Feb 2002 15:53:36 -0800 Organization: http://groups.google.com/ Message-ID: <17247c3d.0202271553.68aaf78d@posting.google.com> References: <3C74E519.3F5349C4@baesystems.com> <3C763746.CC8B2965@baesystems.com> <3C7D37FD.F67F7067@despammed.com> NNTP-Posting-Host: 130.213.23.134 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1014854016 19449 127.0.0.1 (27 Feb 2002 23:53:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 27 Feb 2002 23:53:36 GMT Xref: archiver1.google.com comp.lang.ada:20540 Date: 2002-02-27T23:53:36+00:00 List-Id: Wes Groleau wrote in message news:<3C7D37FD.F67F7067@despammed.com>... > It would not surprise me if the _average_ C compiler > is faster than the _average_ Ada compiler. The Ada > compiler > > - must generate machine code for constraint checks, > elaboration checks, and stack checks Most compilers are limited by the I/O speed of the machine rather than by what they have to do to compile the language or by the machine code they have to generate. In the case of a C module, the compiler has to open/read/close numerous .h files. The number of .h files that are read simply by doing an include on something "simple" like stdio.h can be amazing on some systems; measuring in the dozens, on others it may be a handful. In the case of an Ada module, the compiler has to open/read/close some number of files (GNU => every spec in the WITH closure of the module, Rational => every directly WITH'ed spec of the module). The number varies depending on the compiler. This is the reason that C compiler for older "slow" machines, such as the Amiga or the M68000 had options for creating pre-digested collections of .h files. It reduced the number of opens and reads and greatly increased the perceived performance of the compiler. If you strip away the open/read times for the source code, and the open/write times for the output, there isn't a great deal of reason for an optimizing C compiler and and optimizing Ada compiler to be greatly different in the time they take for comparable source code. The open/write time will be dominated by the open. If "average" compilation times for Ada compilers is larger than that for "average" C compilers, it more likely because Ada compiler writers spend a great deal of time worrying about "correct" and less time worrying about "fast". As a conjecture, the average Ada compiler also tends to have a "large" number of targets (for cross compilation) whereas the average C compiler may not (GCC is a noted exception!). As a user of both GCC and GNAT, they seem to be comparably fast. That is strictly a "How long do I seem to have to wait and do I get impatient." comparison. Also, as a user of both Rational Apex Ada and the C compilers from many Unix vendors, Rational's Ada would seem to compile similar numbers of units per unit of time. At least, I don't get any more impatient compiling a mound of Ada than I do a mound of C. If anything, compiling a large Ada program seems to be faster; which is again a seat-of-the-pants impression rather than formal results of some sort of benchmark.