Static linking considered harmful

Japheth J.C. Cleaver cleaver at redwire.net
Tue Nov 28 02:16:35 UTC 2006


Ulrich Drepper wrote:
> Japheth J.C. Cleaver wrote:
>> (Our mail server saw a
>> performance boost of about 20% when we statically linked our process
>> chain.)
> 
> I *very* much doubt those numbers.  Using PIC and the runtime linker
> does not add that much overhead.  Never has, never will.  If you compare
> apples and oranges you can come up with such numbers, of course.
> 

In the interests of correcting the record...

After researching this I've realized I was mistaken. That speed gain
involved not _just_ static linking, but the migration to dietlibc for
some of the most heavily used portions, as well as replacing bash with a
static ash for all our shell forking (lots). Those may have contributed
a significant portion of that speed bump.

I stand by my original point, however. Some run environments (like our
qmail/vpopmail clusters) benefit from changes that this thread (and the
ones regarding removing or bastardizing dietlibc on fedora-extras)
proposes making more difficult. Let's be perl-like: Make the easy things
easy (dynamic linking as normal) and the hard things possible (optional
-devel-static packages).


Regards,
-jc




More information about the devel mailing list