Re: When/why did function calls get cheap?

Marco van de Voort <marcov@toad.stack.nl>
21 Feb 2003 00:47:35 -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)
Re: When/why did function calls get cheap? gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2003-02-24)
[11 later articles]
| List of all articles for this month |
From: Marco van de Voort <marcov@toad.stack.nl>
Newsgroups: comp.compilers
Date: 21 Feb 2003 00:47:35 -0500
Organization: Eindhoven University of Technology, The Netherlands
References: 03-02-073
Keywords: optimize, practice
Posted-Date: 21 Feb 2003 00:47:35 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? And if so, what happened to
> make function calls cheap. It seems that there's a non-trivial amount
> of work to do to set up a stack frame, etc. compared to just
> continuing along in a straight line processing instructions that do
> the actual work--are there deep black-magic optimizations or did the
> relative costs of something change or something else entirely?


- Compilers started to get smarter, and do inlining of small functions, or
    choose the most optimal calling conventions for small functions (no stack
    frame, sav regse by caller and a few parameters in registers)


- (on Intel) call's DID get cheaper with branch prediction e.d.


- Languages got more high level, and there became costlier constructs than
      the mere procedure call.


Post a followup to this message

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