[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

combreloc



Hello,
    In case you aren't aware a rather significant
change was made recently to binutils. The -z combreloc
support in binutils has been enabled on almost all
arches as of binutils 2.11.92.0.5-3. This coupled with
the recent rebuild of glibc 2.2.4-4 has enabled combreloc
in glibc. Combreloc sorts the cached relocations to speed
up their access and can dramatically reduce the load time
spent in the dynamic linker particularly for large programs
with lots of relocations such as qt/kde.    
    For example on Debian ppc sid we find that with combreloc
disabled in glibc that the linker statistics for the t1 tutorial
program in qt 2.3.1 shows the following...

01338:
01338:  runtime linker statistics:
01338:    total startup time in dynamic loader: 17486340 clock cycles
01338:              time needed for relocation: 13139203 clock cycles (75.1%)
01338:                   number of relocations: 32391
01338:        number of relocations from cache: 0
01338:             time needed to load objects: 567645 clock cycles (3.2%)


which is reduced by about 90% when combreloc is enabled in glibc (and
the binary for t1 and all support libs have been built against the
-z combreloc enabled binutils)....

14355:
14355:  runtime linker statistics:
14355:    total startup time in dynamic loader: 1978861 clock cycles
14355:              time needed for relocation: 1904007 clock cycles (96.2%)
14355:                   number of relocations: 9647
14355:        number of relocations from cache: 22744
14355:             time needed to load objects: 65247 clock cycles (3.2%)


Experimental prelinking of the t1 binary in addition can take the time
spent in the dynamic loader down to 1% of the original value...    

14356:
14356:  runtime linker statistics:
14356:    total startup time in dynamic loader: 135185 clock cycles
14356:              time needed for relocation: 57254 clock cycles (42.3%)
14356:                   number of relocations: 0
14356:        number of relocations from cache: 2555
14356:             time needed to load objects: 67923 clock cycles (50.2%)

So with the current binutils and glibc in sid we can obtain a 90% reduction
in the load time for programs using the existing tools in Debian sid. In
the future an even better reduction will be obtainable with prelinking.
    I am bringing this to your attention since every maintainer should
be aware that if he chooses to do a minor version bump of his packages
they will be rebuilt against the latest devtools (not a bad thing) and
a -z combreloc enabled binutils. This will provide the immediate 
advantage of combreloc support and a reduced load time as well as making
the binary prelink ready for a future addition of prelinking support
to glibc and sid. I just wanted everyone to be aware of what was available
here with the new binutils in case they weren't planning a new release
before Woody is shipped but would be interested in obtaining this 
improved load time from combreloc.
                    Jack Howarth



Reply to: