[patch] ld speedup 1/3 (suffix merge)

Bryce McKinlay bryce@mckinlay.net.nz
Thu Sep 25 09:04:00 GMT 2003


Hi Guys,

I can report that this patch reduces link time for libgcj.so from over 
1:30 to 9 seconds on an AMD XP 1800! This was actually something I was 
planning on looking into after noticing that functions in merge.c 
accounted for >98% of the linker's runtime, but you guys have beaten me 
to it. Thanks!

I can confirm there is a problem with hash collisions however - libgcj 
has over 1M .debug_str strings. Fitting these all in a hashtable with 
~4000 entries is sure to be inefficient. Sure enough, changing 
sec_merge_init to use bfd_hash_table_init_n with a size of ~50000 
almost halved the link time again to ~4.5 seconds.

Is there a way to work out (or estimate) the number of entries in the 
strings section, and set the size of the hash table appropriately?

Regards

Bryce.




More information about the Binutils mailing list