This is the mail archive of the
crossgcc@sourceware.org
mailing list for the crossgcc project.
See the CrossGCC FAQ for lots
more information.
Re: static builds versus dynamic
- From: Bill Gatliff <bgat at billgatliff dot com>
- To: crossgcc <crossgcc at sources dot redhat dot com>
- Date: Fri, 20 Jan 2006 09:22:10 -0600
- Subject: Re: static builds versus dynamic
- References: <200601190340.13695.romank@randrlabs.com>
Roman:
Roman wrote:
I am curious, if anyone had experiences with static builds to share.
Anecdotally, as I haven't done any solid benchmarking.
I have found that static programs may take considerably longer to start
up, presumably because the whole thing gets dragged into memory (well,
in a sense) before before the first instruction runs.
In contrast, dynamic programs generally seem to load a bit quicker, but
may be sluggish at first as the dynamic linker drags in libraries as
they are needed. I'm not completely sure this is even perceptible to
the user, and it very quickly goes away. And it doesn't come back with
repeated invocations of the application, because Linux's buffer cache
holds the library files in memory until there's no room for them anymore
(as it may also do for the disk blocks that hold the static application).
IOW, small static programs seem to be quick to load vs. small dynamic
ones. Big dynamic ones seem to load quicker than big static ones---
especially on repeated invocations. Again, just my observations, no
rigorous testing.
All of this becomes moot if you don't have the space to store all your
applications without shared libraries, of course. And if raw
performance is your only metric, then there probably isn't enough of a
difference between static and dynamic in the steady-state case to pay
attention to. Either that, or you're so close to the edge
performance-wise that you're going to take the plunge at some point
anyway...
b.g.
--
Bill Gatliff
bgat@billgatliff.com
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.org