|
|
Subscribe / Log in / New account

shared libraries [ab]use

shared libraries [ab]use

Posted Aug 5, 2005 13:11 UTC (Fri) by dmantione (guest, #4640)
In reply to: shared libraries [ab]use by hp
Parent article: Our bloat problem

No, that's the wrong assumption. Shared libraries are less expensive than
statically linked ones, but not free.


to post comments

shared libraries [ab]use

Posted Aug 5, 2005 20:25 UTC (Fri) by hp (guest, #5220) [Link] (1 responses)

Avoiding anything "not free" isn't a useful guideline.

The question is what are the tradeoffs. In the shared lib case, for example, avoiding them often means efficiency loss:
- more code running total considering all apps
- each self-implemented version of the code is slower and buggier
than a highly polished common version

Not to mention downsides such as security updates (you want to download libpng, or every single app using libpng?), bugs, lack of features, longer development time.

So if shared libs aren't a significant percentage of the overall problem, then "not free" is irrelevant; if they are a significant percentage of the overall problem then "not free" is probably more an argument for fixing shared libs (or coming up with some less-broken module system than ELF shared libs) rather than an argument for static linking and hand-rolled broken code.

Simplistic answers like "just don't use libs" are not useful. You don't want to warp the UI and implementation of every app in extensive ways just to work around a module system that needs optimizing.

shared libraries [ab]use

Posted Aug 7, 2005 20:45 UTC (Sun) by oak (guest, #2786) [Link]

I think the argument was that each *redundant* (unused) shared library
linked to the binary has a cost.

For example: Just by linking a library (that your program doesn't use),
you've increased your program's memory usage by at least 4KB. At least one
private (non-read-only) page is reserved for symbol resolving of each
linked shared library.

The new linker has a command line option to not to link dynamically
libraries that are not used. I think it was discussed on the Gnome
mailing lists, but globally enabling it had broken some program, so it's
not enabled by default.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds