From mboxrd@z Thu Jan 1 00:00:00 1970 From: lm@mcvoy.com (Larry McVoy) Date: Sun, 3 Jan 2016 17:29:48 -0800 Subject: [TUHS] Early Unix function calls: expensive? In-Reply-To: <5689C601.4080602@update.uu.se> References: <5689C601.4080602@update.uu.se> Message-ID: <20160104012948.GH12305@mcvoy.com> On Mon, Jan 04, 2016 at 02:08:17AM +0100, Johnny Billquist wrote: > On 2016-01-04 00:53, Tim Bradshaw wrote: > >>>On 3 Jan 2016, at 23:35, Warren Toomey 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.