This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gprof is very slow (>100x worse than "before")
- To: Kevin Nomura <nomura at netapp dot com>
- Subject: Re: gprof is very slow (>100x worse than "before")
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 09 Jul 2001 12:48:50 -0700
- Cc: binutils at sources dot redhat dot com
- References: <3B4A091F.D69E6D7D@netapp.com>
Kevin Nomura <nomura@netapp.com> writes:
> I coded a workaround which was to precompute a mapping from address
> to source line, and hook get_src_info to binary-search this mapping.
> Then "gprof --line" takes less than 5 minutes. This is still doing
> a lookup for each byte of the binary as above, so it seems that
> the generic BFD routine is far too expensive for the brute-force
> loop. Certainly core_create_line_syms can be smarter too. But
> I don't know the rules of the game with BFD -- what symbol info
> is exported, what new interfaces are reasonable to add -- these
> rules might steer the fix in a certain direction.
gprof for ELF/stabs was sped up quite a bit by some improvements to
_bfd_stab_section_find_nearest_line. Perhaps similar improvements
could be applied to NAME(aout,find_nearest_line). Perhaps that is
what you have already done.
Ian