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.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!seas.gwu.edu!mfeldman From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: Use pragma INLINE or not? Message-ID: <3398@sparko.gwu.edu> Date: 27 Jun 91 21:00:25 GMT References: <1991Jun18.171459.11744@software.org> <1991Jun19.234429.20796@netcom.COM> <27847@as0c.sei.cmu.edu> Reply-To: mfeldman@seas.gwu.edu () Organization: The George Washington University, Washington D.C. List-Id: In article <27847@as0c.sei.cmu.edu> firth@sei.cmu.edu (Robert Firth) writes: [discussion of execution profiling] > >All my guesses together accounted for 6% of the time. The number >one time sink was a search loop that I'd stupidly written the wrong >way round - the item being looked for was usually near the end of >the list rather than near the beginning. Who would have believed >that mattered for a list of maximum length 18? I reversed the >search and saved almost 20% of the time. Thanks for being courageous enough to admit this. Most of us have had similar experiences. In the end, fixing your algorithm paid off far better than micro-tweaking. My students come from all walks of life, including many industry folks. Sometimes it's very hard to convince the latter (especially, sadly, the C hackers among them), that no amount of micro-tweaking can turn an N**2 program into an N log N program. To do the latter requires at least minimal background in algorithms. Too many students bitch about having to study that "irrelevant stuff." And with all the chatter I read about "software engineering education," I see very little in those quarters about the importance of algorithm analysis and theory. People have suggested we should drop it from our curriculum in favor of heavier emphasis on confiugration management. Figure that out. 'Course no amount of algorithm theory could substitute for a careful analysis of the properties of the data you really expect to see, as you discovered, Robert. Thanks for a good perspective on the subject! Mike