Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 May 2012 13:53:58 +0200
From:      Erik Cederstrand <erik@cederstrand.dk>
To:        Tim Kientzle <tim@kientzle.com>
Cc:        freebsd-current FreeBSD <freebsd-current@freebsd.org>
Subject:   Re: [RFC] Un-staticise the toolchain
Message-ID:  <AF37B4BF-69D5-41D3-819A-0252911CBC89@cederstrand.dk>
In-Reply-To: <A79EE48D-A2AC-4D35-B156-1F58D17F77DD@kientzle.com>
References:  <20120426093548.GR2358@deviant.kiev.zoral.com.ua> <20120426134140.GF14350@lo0.su> <CADLo838sdUT2e%2B7j8vCyOmDithLsh3kwDd_z04dWaPoiMphPDQ@mail.gmail.com> <4F99ACF9.2050609@infracaninophile.co.uk> <CADLo83_sr=13H=9nnrdge0jJaOh5Bk2N_gg=Gf-uYhwM8jm7Xg@mail.gmail.com> <42D8809D-0E99-47A5-802F-71991B5B0B8D@cederstrand.dk> <A79EE48D-A2AC-4D35-B156-1F58D17F77DD@kientzle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Den 01/05/2012 kl. 07.52 skrev Tim Kientzle:
>=20
> On Apr 30, 2012, at 6:41 AM, Erik Cederstrand wrote:
>>=20
>> Can anyone explain to me why the dynamically linked version is =
significantly slower? What are the extra steps involved compared to a =
statically linked binary?
>=20
> At the risk of dramatically over-simplifying=85.
>=20
> When a static binary is started by the kernel, it does the following:
>  * Initializes some libc internals.
>  * Calls main.
>=20
> When a dynamic binary is started by the kernel, it does the following:
>  * Initializes some libc internals.
>  * For every dynamic library referenced by this executable:
>       - loads the dynamic library into memory
>       - fixes up references
>  * Calls main
>=20
> The process of loading the required libraries and fixing up references
> can be quite time-consuming.

Thanks for the explanation. In the previous 'make index' benchmark by =
Chris, make is called very often, which means the dynamic libraries =
should already be loaded into memory after the first run, right? Which =
means the extra time is being spent fixing up references?

Erik=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AF37B4BF-69D5-41D3-819A-0252911CBC89>