Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!sri-spam!mordor!lll-tis!ames!ucbcad!ucbvax!decvax!decwrl!spar!hunt From: hunt@spar.SPAR.SLB.COM (Neil Hunt) Newsgroups: comp.arch,comp.os.misc Subject: Re: Shared libraries (Was: Re: Big Programs Hurt Performance) Message-ID: <1420@spar.SPAR.SLB.COM> Date: Mon, 12-Oct-87 12:16:44 EDT Article-I.D.: spar.1420 Posted: Mon Oct 12 12:16:44 1987 Date-Received: Tue, 13-Oct-87 06:17:31 EDT References: <6886@eddie.MIT.EDU) <2501@xanth.UUCP> <2067@sfsup.UUCP> <443@devvax.JPL.NASA.GOV> <2114@sfsup.UUCP> <439@root44.co.uk> Reply-To: hunt@spar.UUCP (Neil Hunt) Organization: Schlumberger Palo Alto Research - CASLAB Lines: 53 Xref: mnetor comp.arch:2613 comp.os.misc:285 In article <439@root44.co.uk> aegl@root44.UUCP (Tony Luck) writes: >>There is a technique [...] but this implies a >>remarkable performance hit. > >On many architectures I wouldn't call this a "remarkable" performance hit >[...] Thus a typical function call will do at least > > jsr 20 cycles > jmp 12 cycles > rts 16 cycles > >[...] consider a real function with some >local stack frame to set up and 3 registers to save/restore: > > jsr 20 cycles > jmp 12 cycles > link 18 cycles > movm 38 cycles > : > movm 38 cycles > unlk 12 cycles > rts 16 cycles > >Here the overhead is 12 cycles out of 154 i.e. just under 8% - still bad, >bu not a complete disaster - and we still haven't counted any cycles for >the function doing anything at all useful just a fairly typical function >call overhead. > >I guess that this general overhead will not be hugely different on other >architectures. > >-Tony Luck (Porting manager - Root Computers Ltd., London) We are considering 12 cycles on a (say) 25MHz cpu, or 0.5 uS. Now lets consider the performance when we don't have shared libraries, and a function call hits a page fault: jsr 20 cycles page fault interrupt 200 cycles disc latency delay 300000 cycles 50000 instructions to bring in the page 750000 cycles 1000 instructions in OS restoring state 15000 cycles movm ... I think I will opt for the shared libraries, as soon as I can get my hands on SunOS releas 4.0 ! Neil/.