Re: When/why did function calls get cheap?

Joachim Durchholz <joachim_d@gmx.de>
21 Feb 2003 00:46:39 -0500

          From comp.compilers

Related articles
When/why did function calls get cheap? peter@javamonkey.com (Peter Seibel) (2003-02-12)
Re: When/why did function calls get cheap? strohm@airmail.net (John R. Strohm) (2003-02-13)
Re: When/why did function calls get cheap? gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2003-02-13)
Re: When/why did function calls get cheap? bje@redhat.com (Ben Elliston) (2003-02-21)
Re: When/why did function calls get cheap? joachim_d@gmx.de (Joachim Durchholz) (2003-02-21)
Re: When/why did function calls get cheap? marcov@toad.stack.nl (Marco van de Voort) (2003-02-21)
Re: When/why did function calls get cheap? firefly@diku.dk (Peter Finderup Lund) (2003-02-21)
Re: When/why did function calls get cheap? firefly@diku.dk (Peter Finderup Lund) (2003-02-21)
Re: When/why did function calls get cheap? anton@mips.complang.tuwien.ac.at (2003-02-21)
Re: When/why did function calls get cheap? jplevyak@yahoo.com (John Plevyak) (2003-02-21)
Re: When/why did function calls get cheap? {spamtrap}@qeng-ho.org (Arthur Chance) (2003-02-24)
[12 later articles]
| List of all articles for this month |
From: Joachim Durchholz <joachim_d@gmx.de>
Newsgroups: comp.compilers
Date: 21 Feb 2003 00:46:39 -0500
Organization: Compilers Central
References: 03-02-073
Keywords: practice
Posted-Date: 21 Feb 2003 00:46:39 EST

Peter Seibel wrote:
> My understanding is that in Olden Times, Real Programmers avoided
> using lots of small functions because the overhead of a function call
> was considered high. But then, somewhere along the way, the compiler
> writers got clever and made function calls cheap so now nobody worries
> about it. Is that more or less correct?


Partly. First, programmers accepted the overhead, simply because it
made code maintainable that wasn't. Then, programmers simply forgot
about the cost, taking subroutine calls for granted. [1] A few years
after that, compilers that routinely did inlining became commonplace.


[1] I did, myself. I once wondered why my Atari ST was printing so
slowly in graphics mode. I fired up the machine-level debugger and
traced through the kernel, discovering that the Atari went through
about half a dozen subroutine calls before hitting actual hardware. I
still suspected nothing, but counted CPU cycles anyway - and found
that the printer interface was waiting about 80% of the time! I then
inlined the system code, making the CPU wait 80% of the time...


Regards,
Joachim


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.