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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e169af38f0a27bda X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-23 13:05:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!mtvwca1-snh1.ops.genuity.net!chcgil2-snh1.gtei.net!news.gtei.net!wn12feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: When shoul Pragma Inline be used? References: X-Newsreader: Tom's custom newsreader Message-ID: <8Ia6a.229559$HN5.971263@rwcrnsc51.ops.asp.att.net> NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51.ops.asp.att.net 1046034308 12.234.13.56 (Sun, 23 Feb 2003 21:05:08 GMT) NNTP-Posting-Date: Sun, 23 Feb 2003 21:05:08 GMT Organization: AT&T Broadband Date: Sun, 23 Feb 2003 21:05:08 GMT Xref: archiver1.google.com comp.lang.ada:34487 Date: 2003-02-23T21:05:08+00:00 List-Id: "Premature optimization is the root of all evil" Donald Knuth > would probably inline any > single line procedure or function that gets called a lot. Called a lot dynamically. If it gets called from lots of places, you will be adding bloat that may have consequences for program load time, cache misses, etc. Note also that a "single line" can generate a lot more code than multiple lines, depending on what the lines do. > IMO the _right_ way to decide is to profile your program and see which way > works out the best. Agreed. After the program works correctly, but isn't fast enough.