From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <001d01c1c5ef$697addc0$32680c9e@arl.army.mil> From: "AMSRL-CI-C" To: <9fans@cse.psu.edu> References: <9d0beeb37aae80180882f07b494170f3@plan9.bell-labs.com> Subject: Re: [9fans] plan or side effect MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="iso-8859-1" Date: Thu, 7 Mar 2002 10:47:39 -0500 Topicbox-Message-UUID: 6135df70-eaca-11e9-9e20-41e7f4b1d025 > Function calls are cheap. They used to be expensive, but they're > really not any more. Of course that depends on the architecture. I'm really pleased with Motorola's M*CORE, where quite often no registers at all need to be saved across the function call (except the return PC which is automatically pushed on the stack). > you'd have to have a pretty special program before this change could > make a worthwhile improvement. It is also possible, sometimes, to change the algorithm, e.g. hashing has more up-front cost but searching is then cheaper. > Surely inlining is safer than this sort of hack, if you can inline. Yes, that particular hack was to avoid function linkage, which is also what inlining does. The C compilers shipped with the 5620 DMD/630 MTG SGS were very good about automatically inlining small functions.