Shared libraries are not necessary

Sean Eric Fagan sef at kithrup.COM
Thu May 16 18:31:23 AEST 1991


In article <196 at titccy.cc.titech.ac.jp> mohta at necom830.cc.titech.ac.jp (Masataka Ohta) writes:
>I have already proved that
>	1) its space saving is negligible

It is *not* negligible.  It can easily amount to *many* megabytes, with X11,
toolkits, and the like.  *Each* X application gets many, many Kbytes' worth
of code; putting this in a shared library greatly reduces amount of disk
space.

On a SparcStation 2, in /usr/bin/X11, xterm in dynamically linked, xtex
isn't.  xterm is about 180k, xtex is 590k.  A version of emacs 19 is
statically linked, and is over 3MBytes.

A program I found called 'xgif'.  Static-linked is 270k; a dynamic-linked
version (same compiler, just let it use dynamic linking, which was the
default) 73k.  size says:

	text	data	bss	dec	hex
	155648	49152	47376	252176	3d910	xgif
	24576	8192	36552	69320	10ec8	xgif.dynalink

Let's see... that's a savings of 131072 bytes in text alone, not
counting the data.

Now, let's be conservative, and say that you have only about, say, a dozen X
applications on your system (the X server, xterm, xclock, xbiff, xgif,
xtrek, a few programs you've grabbed and compiled).  Using shared libraries
is a savings of 1572864 bytes.  That's 1.5Mbytes.  Taking up disk space all
of the time, whether the programs are in use or not.

That is a *very* conservative estimate.

I don't know about you, but I have *definitely* been on systems where even
an extra 1Mbyte would have saved a lot of hassle and pain.

>	2) shared libraries dose not help software version up
>	   from /etc/hosts to DNS

Please tell that to all of the Sun sites who upgrade to using a nameserver
simply by installing *one new file* (the shared library).

But I forgot:  you don't accept the fact that people can code to use the new
structures and still use /etc/hosts.

-- 
Sean Eric Fagan  | "I made the universe, but please don't blame me for it;
sef at kithrup.COM  |  I had a bellyache at the time."
-----------------+           -- The Turtle (Stephen King, _It_)
Any opinions expressed are my own, and generally unpopular with others.



More information about the Comp.unix.internals mailing list