]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Performance improvements for the ELF dynamic linker. These
authorJohn Polstra <jdp@FreeBSD.org>
Sat, 5 May 2001 23:21:05 +0000 (23:21 +0000)
committerJohn Polstra <jdp@FreeBSD.org>
Sat, 5 May 2001 23:21:05 +0000 (23:21 +0000)
commitc15e7faad5664c29c9b42e74753d8c88ed022b7d
treee8cd794d3440b5225284c78081b9a42bc1c448ba
parent12813062e38d3456b960350684754a124f90db83
Performance improvements for the ELF dynamic linker.  These
particularly help programs which load many shared libraries with
a lot of relocations.  Large C++ programs such as are found in KDE
are a prime example.

While relocating a shared object, maintain a vector of symbols
which have already been looked up, directly indexed by symbol
number.  Typically, symbols which are referenced by a relocation
entry are referenced by many of them.  This is the same optimization
I made to the a.out dynamic linker in 1995 (rtld.c revision 1.30).

Also, compare the first character of a sought-after symbol with its
symbol table entry before calling strcmp().

On a PII/400 these changes reduce the start-up time of a typical
KDE program from 833 msec (elapsed) to 370 msec.

MFC after: 5 days
libexec/rtld-elf/alpha/reloc.c
libexec/rtld-elf/amd64/reloc.c
libexec/rtld-elf/i386/reloc.c
libexec/rtld-elf/rtld.c
libexec/rtld-elf/rtld.h