From: Arch Robison <[log in to unmask]>
Subject: Ada vs. C performance, was Possible to write compiler to Java VM?
Date: 7 Jan 1997 12:31:07 -0500
Organization: Kuck & Associates, Inc.
Sender: [log in to unmask]
Approved: [log in to unmask]
Message-ID: <[log in to unmask]>
Keywords: Ada, C, performance
>[Do Ada compilers really generate better code than C compilers for similar
>source code? -John]
I have one anecdotal data point that says no. While working for my
former employer, I was asked to investigate why a new piece of
software written in Ada was so much slower than its old counterpart in
Fortran. The presumed reason was "new feature and flexibility bloat".
But profiling indicated the problem was really with some basic
old-fashioned numerical inner loops. Not being strong on Fortran, I
rewrote the loops in C for comparison. The C was at least 2x faster.
Inspection of the assembly code indicated that the Ada compiler was
lacking fundamental optimizations present in the C compiler.
This is of course a single data point, probably obsolete. But I think
there is a strong reason to suspect that C compilers will generally
generate better code than Ada compilers. Quality of code is
ultimately not a technology issue; it is an economics issue.
Optimizers (and the rest of compilers) are as good as what people are
willing to pay for, and the C market is much bigger. (Data points to
the contrary cheerfully accepted!)
Arch D. Robison Kuck & Associates Inc.
[log in to unmask] 1906 Fox Drive
217-356-2288 Champaign IL 61820
Send compilers articles to [log in to unmask],
meta-mail to [log in to unmask]