Another linker performance issue

Pascal Obry pascal@obry.net
Fri Mar 2 14:34:00 GMT 2012


Kai,

> Hmm, we could also do in the first call for bfd_link_hash_traverse
> build up a table for undefined-symbol names only.
> And then do the actual operations based on this candidate list only?
> 
> We avoid here at least to run over all symbols in hash_table multiple times

Right. This is close to what I was proposing I think. I've gone this
path but not implementing a new hash table. I've created an array with a
key and associated bfd_link_hash_entry. This array is sorted and
searched using bsearch(). In my small test case the time went from 7s to
0.3s. Looks promising.

Please see attached patch. Bear in mind that I've a limited knowledge in
binutils internal. The patch is a first attempt to fix this issue, I'm
still wondering if it is correct and at least equivalent to the previous
code.

Please review and let me know if this is going in the right direction.

Thanks.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B

-------------- next part --------------
A non-text attachment was scrubbed...
Name: speed-up.patch
Type: text/x-diff
Size: 4474 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20120302/7baa0edc/attachment.bin>


More information about the Binutils mailing list