PATCH: Speed up get_special_section

H. J. Lu hjl@lucon.org
Fri May 6 23:20:00 GMT 2005


On Fri, May 06, 2005 at 04:07:25PM -0700, Eric Christopher wrote:
> On Fri, 2005-05-06 at 15:53 -0700, H. J. Lu wrote:
> > get_special_section scans the whole array for a match. This patch
> > reduces the number of searches.
> 
> And you tested by... ? :)
> 

I run profiling on sec64k.exp. Old:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
 23.33      0.07     0.07     2014     0.03     0.03  subseg_set_rest
 16.67      0.12     0.05    22050     0.00     0.00  hash_lookup
 13.33      0.16     0.04     3012     0.01     0.01 get_special_section

New:

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
 26.79      0.08     0.08     2014     0.04     0.04  subseg_set_rest
  7.14      0.10     0.02    22050     0.00     0.00  hash_lookup
  7.14      0.12     0.02        6     3.33     3.33  hash_new
...
 0.00      0.30     0.00     3012     0.00     0.00 get_special_section


H.J.



More information about the Binutils mailing list