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,c615e41a65104004 X-Google-Attributes: gid103376,public From: ak@muc.de Subject: Re: Performance Ada and C Date: 1998/07/04 Message-ID: #1/1 X-Deja-AN: 368564018 Sender: andi@fred.muc.de References: <35921271.E51E36DF@aonix.fr> <3598358A.73FF35CC@pipeline.com> <6nh762$66i@netline.jpl.nasa.gov> <359CB19D.EDAD6D1F@cl.cam.ac.uk> <359D4C6F.5691A370@cl.cam.ac.uk> Distribution: world Organization: [posted via] Leibniz-Rechenzentrum, Muenchen (Germany) Newsgroups: comp.lang.ada Date: 1998-07-04T00:00:00+00:00 List-Id: Markus Kuhn writes: > > Basically the only difference is that I replaced the macros in the C > version by inline functions. Are as far as performance and optimization > are concerned, I just think of inlined functions as a sort of macros > with type checking, so this should not cause the difference. At least in the C frontend inline functions are not equivalent to macros (in contrary to the documenation). The gcc backend seems to miss several optimizations that it does with C-style macros (mainly CSE). Also the register allocator (on x86) seems to have some problems with inline functions. I assume Gnat has the same problem. egcs-current has a new GCSE pass that might help a bit, but there are still other problems (e.g. if you work with objects gcc is very bad to keep small objects in registers if you use inline functions - it always flushes them at the border of the inline etc.) -Andi P.S.: Is something like the Stepanov Benchmark available for Ada95?