Subject: Re: why ld.elf_so is slow starting mozilla
To: None <tech-toolchain@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-toolchain
Date: 10/03/2002 18:57:47
> It maybe worth saving the symbol table info in an entirely
> different structure - optimised for each name only being
> defined once.

ok, I seem to have the above working.
mozilla (re)loads in about 2.7 seconds, I'm sure it was nearer
6 seconds last week.

Changes:
1) Don't set RTLD_GLOBAL when calling _rtld_load_needed_objects
   for the program body (_rtld() in rtld.c)
2) Don't add objects with obj->main set into 'dag' lists [1].
3) Build a new symbol table for program body (in rtld() just
   after change 1.
4) Use the new symbol table in _rtld_find_symdef()

For small programs building the table tables a while - so I
only do it if there are many shared libraries.
For mozilla the table build takes about 17ms, completely
dwarfed by the saving when fixing up libgkcontent.so.

I've put the modified symbol.c onto my web space, functions
_rtld_symlook_main and _rtld_process_main_symtab (to be called
from rtld()) are the main changes.
I haven't merged in the recent changes yet though :-(

http://www.btinternet.com/~david.laight/netbsd/ld.elf_so/symbol.c
or follow from www.l8s.co.uk
That directory contains all he source for a working i386 ld.elf_so.

	David

[1] This isn't the correct version of this optimistaion...

-- 
David Laight: david@l8s.co.uk