Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: setjmp/longjmp Message-ID: <4629@utzoo.UUCP> Date: Tue, 13-Nov-84 15:17:02 EST Article-I.D.: utzoo.4629 Posted: Tue Nov 13 15:17:02 1984 Date-Received: Tue, 13-Nov-84 15:17:02 EST References: <1@imd.UUCP>, <469@ncoast.UUCP> <4600@utzoo.UUCP>, <2562@dartvax.UUCP> Organization: U of Toronto Zoology Lines: 20 > > Alas, even pushing a constant on every function call is a lot of expense > > when every call has to pay it just so a few can do longjmp(). > > I find it hard to believe that your compiler is so good at optimizing > code that a single instructuion (okay, 2 instructions on our honeywell) > on each function call is going to make that much difference. I'm on a pdp11, where the calling sequence is not all that great, maybe eight or ten instructions (I forget...). Even adding one instruction to this is perhaps a 5-15% difference in speed. This is *not trivial* when we are talking about the most commonly-used control structure in C code -- if, while, and such don't even come close -- and when you bear in mind that the function-call sequence has a history of being a major factor in the speed of C code. No joke: when you profile a program on a machine like the 11, where the C calling sequence stubs show up in the profile, they usually aren't all that far down the sorted list. Function-call overhead is a major expense in C programs. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry