From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 3 May 93 21:21:10 GMT From: eachus@mitre-bedford.arpa (Robert I. Eachus) Subject: Re: ADA Performance Message-ID: List-Id: I'd like to go a little further than Robert Dewar and say that this test violates several important principles about interlanguage benchmarking. The first and most important is that you must compare two versions of the SAME program with the same data. The difference in the data I'll assume was a typo, but the difference in programs is major. All the Ada versions except case8 and case9 start the timed loop with a function call, while the FORTRAN version starts with a static value. On most compilers I know of this is enough to defeat movement of code out of the loop... Second, use the same clock! Wall clock time is okay, but know what you are doing and use a dedicated machine. (A dedicated machine is usually needed for other reasons...) Usually when comparing two programming languages you either have to do some implementation dependent coding to get to the same OS clock call, or time the execution time for the entire benchmark in the OS environment, such as the Unix "time;test_program;time". Third use each the features of each language as they are expected to be used. If you are benchmarking FORTRAN 77 vs. Ada 83, the Ada program should use (user defined) vector operations instead of loops in the main program and multiple calls to user written subroutines. (If the comparison is to FORTRAN 90, then both programs should use vector operations...) I won't write and run such a version because of the other problems with this benchmark, but it is relatively easy: type Complex is private; type Complex_Vector is array (Integer range <>) of Complex; ... function "*"(L,R: Complex_Vector) return Complex; ... Now a good Ada compiler will do pretty well, since it can keep everything except the big vectors in registers. Of course, a good FORTRAN 90 compiler will skip 99 interations of the outer loop. :-) -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...