Shared libraries (was Re: Window system bashing (was Re: X11 bashing))

Curtis Yarvin cgy at cs.brown.edu
Sun Apr 28 14:43:40 AEST 1991


In article <BZS.91Apr28000804 at world.std.com> bzs at world.std.com (Barry Shein) writes:
>
>From: sef at kithrup.COM (Sean Eric Fagan)
>>Using shared libraries dropped SCO's distribution from 60 or so floppies to
>>about 25 or 30 (they're compressed, as well; the actual floppy count is 13
>>or 15, I believe; I doubled for that previous estimate).
>>
>>Want to tell me again that shared libraries are bad?
>
>Well, there's more to life than saving disk space. Shared libraries
>also incur a performance hit which varies on different systems (and
>applications on the same system, for example.)
>
>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.

Either way, the cost is CONSTANT relative to the execution time of the
program.  It will be on the same order for a 10-hour rendering job and
main() { printf("Hello, world.\n"); }.

Thus it is utterly misleading to talk about the performance cost of shared
libraries in percentage terms.

Barry Shein is a very intelligent person and no doubt knows this.

Curtis



More information about the Comp.unix.wizards mailing list