comp.lang.ada
 help / color / mirror / Atom feed
From: munck@STARS.RESTON.UNISYS.COM (Bob Munck)
Subject: Re: Ada vs C implementation efficiency
Date: 19 Jun 91 14:16:50 GMT	[thread overview]
Message-ID: <1336.677341010@osprey> (raw)

In INFO-ADA Digest V91 #165, eachus@mitre-bedford.arpa  (Robert I. Eachus)
said:

> ...  In general, for good compilers
>and good benchmarks a program will run fastest in the language it was
>originally written in.

You CAN'T mean that exactly as written.  Surely the history of a benchmark
has little to do with its results.  Maybe you mean something like "line-at-
a-time, uncritical translation of a program from one language to another
almost always result in poor performance of the translated program compared
to the original."?

>     My personal approach, based on this experiment and others, is to
>go for correctness first, and if you need better performance, look at
>the algorithms, THEN at the code.  I have gotten to the point of
>looking at generated code once or twice, but in every case I have
>found a way to coerce the compiler to generate what I wanted.

An important point, and something that a lot of programmers learn late in
their careers or not at all.  Note too that this approach to performance
tends to preserve maintainability.  My way of stating this approach:

                RULES FOR PROGRAM OPTIMIZATION:
                
                1. Don't do it.
                
                2. (Experts only) Don't do it yet.
                
I do have my doubts about "coerce the compiler to generate what I wanted."
What happens when a new compiler release doesn't coerce the same way?  Besides,
playing with object code makes hair grow on your palms.

Bob Munck

             reply	other threads:[~1991-06-19 14:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-06-19 14:16 Bob Munck [this message]
1991-06-20 19:37 ` Ada vs C implementation efficiency Robert I. Eachus
  -- strict thread matches above, loose matches on Subject: below --
1991-06-15 17:37 Sam Harbaugh-AFES PROJECT
1991-06-17  9:49 ` George C. Harrison, Norfolk State University
1991-06-19 23:33   ` Bob Kitzberger @sation
1991-06-18 16:48 ` Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox