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=2.6 required=5.0 tests=BAYES_20,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!STARS.RESTON.UNISYS.COM!munck From: munck@STARS.RESTON.UNISYS.COM (Bob Munck) Newsgroups: comp.lang.ada Subject: Re: Ada vs C implementation efficiency Message-ID: <1336.677341010@osprey> Date: 19 Jun 91 14:16:50 GMT Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: munck@STARS.Reston.Unisys.COM Organization: The Internet List-Id: 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