Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Aug 1997 01:51:01 -0500 (EST)
From:      "John S. Dyson" <toor@dyson.iquest.net>
To:        perlsta@sunyit.edu (Alfred Perlstein)
Cc:        toor@dyson.iquest.net, hackers@FreeBSD.ORG
Subject:   Re: shared libraries?
Message-ID:  <199708280651.BAA07871@dyson.iquest.net>
In-Reply-To: <Pine.BSF.3.96.970828022111.28125A-100000@server.local.sunyit.edu> from Alfred Perlstein at "Aug 28, 97 02:27:48 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Alfred Perlstein said:
> > > If most of the libraries were converted to a shared lib format wouldn't
> > > that reduce memory and disk space requirements tremendously?
> > > not only that, but complile times and exec times would soar, woudn't they?
> > >
> > Believe it or not, shared libs often hurt more than help.  Even with an
> > ideal scheme that is prelinked, a program can take MORE memory, not less.
> > We share the .text of programs even without using shared libs.  In the
> > case of shells, shared libs are usually a loose.  A rule of thumb that I use
> > is (These are only my opinions):
> 
> I'm not arguing, just asking, why would using shared libraries hurt?
>
Locality of reference is the biggest issue.  There are other issues
that involve setting up more mapped segments, and that on the X86, PIC
code is noticably less efficient.

> 
> a slew of programs are run each using the same suite of standard library
> functions, only one copy of the routines need be present in memory.
> i know that for forking only data is copied, and then only when it is
> nessesary, but for each program we are talking about duplicated TEXT?
> 
> how can shared libs not be the answer?
> 
Because of my answer above.  Programs like sh, etc are
already shared (programs from the same vnode share text and unmodified
data automatically, with no penalty.)

>
> also below, is there a reason several of the things listed don't use
> shared libs?
> 
Yep, refer to my comments above.

>
> i think i understand /bin and /sbin not using them, but i would never have
> guessed that the text editors wouldn't as well as servers...?
> 
Say you are running N copies of vi or emacs -- you are already sharing
them.  It often doesn't pay to add the overhead of the shared libs.
For example, if you link bash shared you will be able to measure slowdowns
in the system, and more memory usage.  If you are running a big ftp site,
the same kind of thing applies for the ftpd.

-- 
John
dyson@freebsd.org
jdyson@nc.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708280651.BAA07871>