On Wed, Oct 08, 2008 at 09:13:01AM -0700, Ulrich Drepper wrote:
> It turns out that most of the time is spend iterating inline
> (dwarf_func_inline_instances). So I created a straightforward cache
> that simply finds all the inline instances in given CU, and stuffs them
> into one array. [...]
So, why not provide an iterator over the inline functions and have
the caller create whatever data structure they need? This seems
more generic since then the search can be customized.
That's possible, but would force yet more caching into the client
side. The more foreseeable caching opportunities should be centrally
provided instead of duplicated.
Plus, it doesn't punish users which make only a few such calls.
If the cache is populated during the first actual call, then its
presence need not punish users.