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 autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!uunet!europa.asd.contel.com!noc.sura.net!haven.umd.edu!uvaarpa!software.org!stluka From: stluka@software.org (Fred Stluka) Newsgroups: comp.lang.ada Subject: Re: Use pragma INLINE or not? (SUMMARY) Summary: Not until you know where the time is spent. Message-ID: <1991Jun28.150915.7269@software.org> Date: 28 Jun 91 15:09:15 GMT References: <1991Jun19.234429.20796@netcom.COM> <27847@as0c.sei.cmu.edu> <3398@sparko.gwu.edu> Sender: usenet@software.org (Usenet News/Mail Support) Organization: Software Productivity Consortium, Herndon VA List-Id: As promised, here is a summary of responses I got via e-mail. In general the e-mailed responses spanned the same range as the posted ones, with most people agreeing that you shouldn't INLINE unless you are sure you need to. In a time-critical environment, where you are *sure* of where the bottlenecks are, then you can probably do a better job than the compiler. Otherwise, write all the code without INLINE, then use a performance analyzer to determine where to add them for maximum effect. Other points worth mentioning: From: gdfwc3!jesmith@texsun.Central.Sun.COM (Jesse Smith) The VAX/VMS Ada 2.1 compiler switch /OPTIMIZE=(TIME,INLINE:MAXIMAL) made code run 20% faster than just: /OPTIMIZE=TIME From: Eric_Alan_Christiansen@cup.portal.com INLINE causes problems during development: - Obscures code a symbolic debugger, but if disabled with a command line switch, causes warnings to be generated, obscuring other more relevant messages. - Creates dependencies of callers on bodies, not just specs, forcing more recompilations. Also, inlining is sometimes desired for a routine when called by caller A (for speed), but not when called by B (for space or for reduction in dependencies). INLINE applies always or never. Compilers may internally do a better job. Thanks for the input, --Fred -- Fred Stluka Internet: stluka@software.org Software Productivity Consortium UUNet: ...!uunet!software!stluka 2214 Rock Hill Rd, Herndon VA 22070 USA Voice: (703)742-7236