This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ELF prelinking (was: Linking speed for C++)


On Thu, May 31, 2001 at 01:34:12PM -0700, Waldo Bastian wrote:
> On Thursday 31 May 2001 08:24, Jakub Jelinek wrote:
> > Hi!
> >
> > This is just a heads up.
> > I've spent last two weeks working on ELF prelinking.
> 
> Great! The improvement in time is better than what I dared to expect. You 
> might also want to see what it does for cow pages, e.g. I would expect to see 
> a noticable saving in used memory when running 5 copies of konqueror in 
> parallel with prelinked libs vs running 5 copies with the normal libs.

Sure, there is some memory saving too:

To get the numbers of how much memory was used till main, I recompiled
konqueror binary (note to non-KDE folks, konqueror is actually
echo > konqueror.cc, even main is in shared library), so that it defines
main (and thus does not use the one in the library) and put a sleep call
into it.
/proc/<pid>/statm output below, there is obviously no difference between
used pages with lazy binding and without lazy binding, since all .plt (well,
on IA-32 .plt.got) slots are touched anyway (to adjust for l_addr resp. to
undo prelinking if it cannot use prelinking) if not prelinking:

prelinked					373 373 243 6 0 367 130
non-prelinked					1099 1099 927 3 0 1096 172
non-prelinked binary against prelinked libs	1160 1160 988 3 0 1157 172

So, for konqueror one saves on IA-32 up to 168K per instance.
The growth from 3 to 6 mapped text pages is because of
.gnu.conflict/.gnu.liblist walking, the growth from 1099 to 1160 total pages
for non-prelinked vs. prelinked libraries (they can be shared though) is
caused mainly by the REL -> RELA conversion (perhaps the conversion could be
skipped if .rel.* sections don't contain any R_386_32 and R_386_PC32
relocs).

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]