Den 01/05/2012 kl. 07.52 skrev Tim Kientzle: > > On Apr 30, 2012, at 6:41 AM, Erik Cederstrand wrote: >> >> 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? > > At the risk of dramatically over-simplifying…. > > When a static binary is started by the kernel, it does the following: > * Initializes some libc internals. > * Calls main. > > 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 > > 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? ErikReceived on Tue May 01 2012 - 09:54:07 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:26 UTC