The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: scj@yaccman.com (scj@yaccman.com)
Subject: [TUHS] Early Unix function calls: expensive?
Date: Sun, 3 Jan 2016 16:42:45 -0800	[thread overview]
Message-ID: <a3f91e2b1d49d6cc11b78b419a42a455.squirrel@webmail.yaccman.com> (raw)
In-Reply-To: <20160103233543.GA10102@minnie.tuhs.org>

Well, I certainly said this on several occasions, and the fact that it is
recorded more or less exactly as I remember saying it suggests that I may
have even written it somewhere, but if so, I don't recall where...

As part of the PCC work, I wrote a technical report on how to design a C
calling sequence, but that was before the VAX.  Early calling sequences
had both a stack pointer and a frame pointer, but for most machines it
was possible to get by with just one, so calling sequences got better as
time went on.  Also, RISC machines with many more registers than the
PDP-11 also led to more efficient calls by putting some arguments in
registers.  Later standardizations like varargs were painful on some
architectures (especially those which had different registers for pointers
and integers).

The CALLS instruction was indeed a pig -- a space-time tradeoff in the
wrong direction!  For languages like FORTRAN it might have been justified,
but for C it was awful.  It is my memory too that CALLS was abandoned,
perhaps first at UCB.  But I actually had little hands-on experience with
the VAX C compiler...

Steve




> I just re-found a quote about Unix processes that I'd "lost". It's by
> Steve Johnson:
>
>     Dennis Ritchie encouraged modularity by telling all and sundry that
>     function calls were really, really cheap in C. Everybody started
>     writing small functions and modularizing. Years later we found out
>     that function calls were still expensive on the PDP-11, and VAX code
>     was often spending 50% of its time in the CALLS instruction. Dennis
>     had lied to us! But it was too late; we were all hooked...
>     http://www.catb.org/esr/writings/taoup/html/modularitychapter.html
>
> Steve, can you recollect when you said this, was it just a quote for
> Eric's book or did it come from elsewhere?
>
> Does anybodu have a measure of the expense of function calls under Unix
> on either platform?
>
> Cheers, Warren
>




  parent reply	other threads:[~2016-01-04  0:42 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 23:35 Warren Toomey
2016-01-03 23:53 ` Tim Bradshaw
2016-01-04  0:01   ` John Cowan
2016-01-04  4:40     ` Armando Stettner
2016-01-04  8:52       ` Tim Bradshaw
2016-01-04 17:29         ` Larry McVoy
2016-01-04 13:50       ` Clem Cole
2016-01-05  2:00       ` Ronald Natalie
2016-01-05 15:13         ` Clem Cole
2016-01-05 16:46           ` John Cowan
2016-01-05 17:33             ` Diomidis Spinellis
2016-01-05 17:42             ` Clem Cole
2016-01-05 17:28           ` Ronald Natalie
2016-01-05 17:43             ` Clem Cole
2016-01-05 17:46               ` Ronald Natalie
2016-01-05 18:03                 ` Warner Losh
2016-01-05 18:24                   ` Ronald Natalie
2016-01-05 20:26                     ` scj
2016-01-05 20:49                     ` John Cowan
2016-01-05 23:24         ` Dave Horsfall
2016-01-05 23:55           ` Ronald Natalie
2016-01-04  0:00 ` John Cowan
2016-01-04  0:42 ` scj [this message]
2016-01-04 11:35   ` Tony Finch
     [not found] <mailman.3.1451865187.15972.tuhs@minnie.tuhs.org>
2016-01-04  1:08 ` Johnny Billquist
2016-01-04  1:29   ` Larry McVoy
2016-01-04  1:31 Noel Chiappa
2016-01-04  2:24 ` scj
2016-01-04  4:24   ` Larry McVoy
2016-01-04  1:59 Norman Wilson
2016-01-04 15:09 ` John Cowan
2016-01-04  2:21 Clem Cole
2016-01-04 12:53 Noel Chiappa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a3f91e2b1d49d6cc11b78b419a42a455.squirrel@webmail.yaccman.com \
    --to=scj@yaccman.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).