Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!world!bzs From: bzs@world.std.com (Barry Shein) Newsgroups: comp.unix.wizards Subject: Re: Shared libraries (was Re: Window system bashing (was Re: X11 bashing)) Message-ID: Date: 5 May 91 01:29:41 GMT References: <1991Apr19.005739.2321@servalan.uucp> <135@titccy.cc.titech.ac.jp> <1991Apr25.175847.21613@kithrup.COM> <73761@brunix.UUCP> Sender: bzs@world.std.com (Barry Shein) Organization: The World Lines: 50 In-Reply-To: cgy@cs.brown.edu's message of 28 Apr 91 04: 43:40 GMT From: cgy@cs.brown.edu (Curtis Yarvin) >>Try running some job using shared and statically linked libraries on >>various systems. I've seen from 5-10% to 75% performance degradations >>(granted the last was odd enough to look into, but it was there.) > >This is true, but 99.97% bogus. > >Statically linked shared libraries should incur little or no performance hit. > >Dynamically linked shared libraries (a la Sun) will incur a performance hit, >but it is completely misleading to talk about the hit in percentage terms. >The linking occurs either at initial runtime or when the linked function is >called. In the former case, the cost is dependent on the number of >libraries linked with; in the latter (I'm not sure which systems use this - >maybe none), it is dependent on the number of library functions called. Have you actually made any attempt to measure this effect? Or are you just drawing conclusions from a few facts you have lying around? I have been doing some measuring. For an easy laboratory, try compiling dhrystone 2.1 static and dynamic on various systems and see how many dhrystones you get on each. Vary the number of runs through the program also, should give some feeling as to whether or not there is an asymptote. There are other effects here than sheer code count, most noticeably instruction cache flushing due to either branches or even self-modifying code (I haven't even thought about code locality as I'm purposely looking at small programs which shouldn't page.) But the lesson may be: Two things which are different are rarely the same. And they may be different in more ways than you first think. As I said, it depends a lot on the implementation (both software and hardware), finding systems which vary little can not be generalized. Some systems will show little difference, some may show 50% or more performance drops. The latter are probably correctable, although unless you have source or even access to the cache designs this may be difficult. >Barry Shein is a very intelligent person and no doubt knows this. Indeed, that's a good reason to be much more careful when criticizing :-) -- -Barry Shein Software Tool & Die | bzs@world.std.com | uunet!world!bzs Purveyors to the Trade | Voice: 617-739-0202 | Login: 617-739-WRLD