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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,35ed85a9d92a025 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Ada-95 for numerics? Date: 1996/04/01 Message-ID: #1/1 X-Deja-AN: 145337448 references: <4jocek$h5h@rigel.rz.uni-ulm.de> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-04-01T00:00:00+00:00 List-Id: " c.) Is this a GNAT specific result or do the commercial compilers show the same behaviour? d.) Is there a way to speed up the program? Perhaps without suppressing all checks? (It seems somewhat brute to take away a lot of those things that are real advantages of Ada...)" First, comparing GNAT with checks to C without checks is apples and oranges, so undoubtedly a big part of the factor of 6 comes from these checks (you can definitey minimize the checks by proper use of subtypes etc, but right now GNAT does not do much to minimize checks, there are lots of ways in which it could do a lot better). Second, are you using unconstrained arrays? This again is a big difference between C and the Ada code. You will find that if you turn off checks and use constrained arrays, that you come much closer in speed. (GNAT does not handle unconstrained arrays very well on some architectures, for a very simple reason that we understand well, and intend to fix at some point). Our priorities in GNAT development are first to get te functionality complete and realiable, and second to optimize and improve the quality of the code. There are a LOT of optimization opportunities, which we wlil visit as GNAT development continues. Actually I must say that numerical codes of this kind are not our first priority. That's because relatively few GNAT users have critical performance requirements in this area. By comparison, exception handling efficiency is a lot more important, and 3.04 wlil feature VERY much improved performance in this area, especially on Solaris and SunOS. P.S. you might post the exact code you are using, that would enable answering your questions more precisely. The ratio of speed between different languages can often be very dependent on coding details (in any language).