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,cf34599caf2fa938 X-Google-Attributes: gid103376,public From: sands@clipper.ens.fr (Duncan Sands) Subject: Re: GNAT function calling overhead Date: 1995/04/07 Message-ID: <3m3dad$bov@nef.ens.fr>#1/1 X-Deja-AN: 100070335 distribution: world references: <3m0nv1$pv2@nef.ens.fr> <3m0psq$fl2@stout.entertain.com> <1995Apr6.163740@di.epfl.ch> organization: Ecole Normale Superieure, PARIS, France newsgroups: comp.lang.ada Date: 1995-04-07T00:00:00+00:00 List-Id: In article <1995Apr6.163740@di.epfl.ch>, Robb.Nebbe@di.epfl.ch (Robb Nebbe) writes: |> In article <3m0nv1$pv2@nef.ens.fr>, Duncan Sands wrote: |> >PS: The corresponding C code takes about 6 seconds. This surprises |> >me too. |> |> |> The main reason is most likely that the Ada code is not at all equivalent |> to the C code. |> |> If you declare |> |> type Matrix is array( 0 .. 14, 0 .. 14 ) of Float; |> |> and write the loops in a way that allow the compiler to optimize out |> the bounds checks (not sure if GNAT does this) then you should get |> the same result as with C; Thanks for your comments. Actually I compiled with all checking suppressed (range checking and others) for exactly this reason. Therefore range checking is not the culprit. I'm not too sure what the culprit could possibly be. In any case, the comparison I made with C was quick and nasty so should be taken with a pinch of salt. Duncan Sands.