Ada speed vs. C...

Tim Olson tim at nucleus.amd.com
Wed Mar 14 03:31:39 AEST 1990


In article <8347 at hubcap.clemson.edu> wtwolfe at hubcap.clemson.edu (Bill Wolfe) writes:
| 
|    In response to recent requests for comparisons of the speed of
|    the code generated by Ada compilers vs. C compilers, the following
|    results were originally described at the Tri-Ada '88 conference
|    in Charleston, WV on October 26, 1988:
|  
| --------------------------------------------------------------------------
| Among the C compilers chosen were those that produced the best times on 
| 16.77 Mhz 68020 based machines out of a list of published dhrystone results 
| for 300 compilers.  The TeleSoft TeleGen2 optimizing compiler was compared 
| against four other C compilers:
| 
|           Sun/Unix 3.2 C on a Sun 3/160
|           GreenHills C on ISI optimum V machine
|           Gnu C on a Sun 3/160
|           MASSCOMP C on RTU 3.1, NC-5700 machine
| 
| MASSCOMP had the best C compiler, our Ada compiler only beat it by a very
| small margin.

Dhrystone should not be used to compare the performance of Ada
compilers vs. C compilers.  It over-emphasizes string operations,
which ends up penalizing C with its implementation of null-terminated
strings. Many compiler/machine combinations spend ~30% of their time
in strcpy() when running this benchmark!

Most real programs don't use the string routines nearly as much as
Dhrystone, so the performance difference between Ada and C on this
benchmark doesn't reflect real-world results.  I'm not saying that Ada
is necessarily slower than C on non-string-intensive code, but the
performance of a number of different benchmarks should be compared to
ensure that you aren't seeing an anomaly or artifact of a particular
benchmark.


	-- Tim Olson
	Advanced Micro Devices
	(tim at amd.com)



More information about the Comp.lang.c mailing list