[TUHS] Early Unix function calls: expensive?

Larry McVoy lm at mcvoy.com
Mon Jan 4 11:29:48 AEST 2016


On Mon, Jan 04, 2016 at 02:08:17AM +0100, Johnny Billquist wrote:
> On 2016-01-04 00:53, Tim Bradshaw <tfb at tfeb.org> wrote:
> >>>On 3 Jan 2016, at 23:35, Warren Toomey<wkt at tuhs.org>  wrote:
> >>>
> >>>Does anybodu have a measure of the expense of function calls under Unix
> >>>on either platform?
> >>>
> >I don't have the reference to hand, but one of the things Lisp implementations (probably Franz Lisp in particular) did on the VAX was not to use CALLS: they could do this because they didn't need to interoperate with C except at known points (where they would use the C calling conventions).  This change made a really significant difference to function call performance and meant that on call-heavy code Lisp was often very competitive with C.
> >
> >I can look up the reference (or, really, ask someone who remembers).
> >
> >The VAX architecture and its performance horrors must have killed DEC, I guess.
> 
> I don't know if that is a really honest description of the VAX in
> general, nor DEC. DEC thrived in the age of the VAX.
> However, the CALLS/CALLG and RET instructions were really horrid for
> performance. Any clever programmer started using JSB and RSB
> instead. as they give you the plain straight forward call and return
> semantics without all the extra stuff that the CALL instructions
> give.
> 
> But, for assembler programmers, the architecture was nice. For
> compilers, it's more difficult to do things optimal, and of course,
> it took quite a while before hardware designers had the tools, skill
> and knowledge how to implement complex instruction sets fast in
> hardware. But nowadays, that is definitely not a problem, and it was
> more or less already solved by the time of the NVAX chip as well,
> which was actually really fast compared to a lot of stuff when it
> came out.
> 
> 	Johnny

Yeah, I agree.  The VAX was pretty pleasant.  I never warmed up to it as
much as I warmed up to the PDP-11 (has to be the most pleasant working
CPU I've used - I say working because NS320xx seemed like it would be
pleasant).  I wrote a user level thread library that ran on the VAX and
I had to write the assembler for swtch() and it was pretty easy.



More information about the TUHS mailing list