Dan Sugalski wrote:

> This is actually one of the spots I'm hoping to pick up a win from--if the
> only code that links against the system socket library is in the code
> that's not loaded by default, then that means one fewer system library to load.
> 
> Granted, odds are the library's in memory already, but we don't have to map
> it, and we don't need to do symbol resolution, and we generally just don't
> need to mess with it.

Most modern runtime linkers do lazy linking, so references aren't
resolved until called.  On Solaris the runtime linker patches itself in
to the PLT, so that the first time a function is called it is resolved. 
Uncalled functions aren't linked.  I think you'll be dissapointed by the
difference.

> Big win? No. Small one. But for code that just rips through a disk file or
> something piped in on stdin, it might mean a few milliseconds shaved off
> startup.

You already have this win:

# Force symbol resolution on startup
$ LD_BIND_NOW=1  ptime perl -e 'exit(0)'
real        0.029
user        0.021
sys         0.007

# Default lazy linking
$ ptime perl -e 'exit(0)'               
real        0.019
user        0.010
sys         0.007

Alan Burlison

Reply via email to