This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Another linker performance issue


> Sadly not 20% :( I've tested with your patch and the performance
> increase is only 3% that is we gain 1s (from 36.9s to 35.9s) in my small
> test.

Thank you for the synthetic test code.

The original profile showed an average of 1991171953 / 12871 = 154702
calls to pe_undef_alias_cdecl_match per call to bfd_link_hash_traverse.
There are about 150K symbols, right?

The next thing to try might be a new routine bfd_link_hash_traverse_undefined(),
which would hoist the filter "if (h->type == bfd_link_hash_undefined)"
into the traversal, avoiding the call to the parametric subroutine
when a symbol is defined.

Another idea, more along the lines of different global strategy:
Do the calls to pe_find_cdecl_alias_match() come in batches,
such as all the symbols needing alias resolution are checked together?
Then for each batch, build an array of pointers to the undefined symbols only.
Run bfd_link_hash_traverse() once to just count the undefined symbols;
allocate an array of that many pointers.  Then run bfd_link_hash_traverse()
again, filling in the array.  Now do an entire batch of alias matching
on the array of undefined symbols.  Then free() the array of pointers.

-- 


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