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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.lang.c:26855 comp.software-eng:3169 comp.lang.ada:3436 Path: utzoo!attcan!uunet!crdgw1!sunroof!hammondr From: hammondr@sunroof.crd.ge.com (Richard A Hammond) Newsgroups: comp.lang.c,comp.software-eng,comp.lang.ada Subject: Re: Ada speed vs. C... Message-ID: <6015@crdgw1.crd.ge.com> Date: 13 Mar 90 16:45:11 GMT References: <8347@hubcap.clemson.edu> Sender: news@crdgw1.crd.ge.com Followup-To: comp.lang.c Organization: General Electric Corporate R&D Center List-Id: In article <8347@hubcap.clemson.edu> wtwolfe@hubcap.clemson.edu (Bill Wolfe) writes: Summary: Bill just reposted an article from Gary Morris of Telesoft which reported that the Dhrystone results for the Telesoft compiler on a 16.67 Mhz 68020 based system beat out 4 C compilers on similar systems. The results were reported in 1988 at the Tri-Ada conference. As even Reinhold Weicker admits (posting to Usenet, also in Sigplan Notices): 1) Dhrystone uses only the "Pascal Subset" of Ada. 2) Ada runtime checks should be disabled for comparison to other languages! 3) There is some concern that string operations are over-represented, as HrDr Weicker notes: [ quoted from his posting of Feb 11, 1989] It should be noted that this is a language-dependent issue: Dhrystone was first published in Ada, and with Ada or Pascal semantics, the time spent in the string operations is, at least in all implementations known to me, considerably smaller than in C. In Ada and Pascal, assignment and comparison of strings are operators defined in the language, and the upper bounds of the strings occuring in Dhrystone are part of the type information known at compilation time. The compilers can therefore generate efficient inline code whereas in C, the string operations must be expressed in terms of the C library functions "strcpy" and "strcmp". (This is probably the main reason why on most systems known to me, the Ada and Pascal version are faster than the C version.) I admit that the string comparison in Dhrystone terminates later (after scanning 20 characters) than most string comparisons in real programs. For consistency with the original benchmark, I didn't change the program despite this weakness. -- END QUOTE -- So, while it is nice to see that Ada compilers can do as well as or better than C, be aware of the conditions of the test and be sure that you understand what the benchmarks measure. In particular, I'd suggest getting the number for the runtime checks enabled run, since that should be the way you actually run Ada programs. Rich Hammond