Re: [RFA] Type cleanups

Daniel Jacobowitz
2002-05-13T18:46:55Z

On Mon, May 13, 2002 at 12:31:09AM -0400, Andrew Cagney wrote:
> >Does this mean that ``struct type *'' is becoming opaque? Looking at
> >>the next patch, no, sigh.
> >
> >
> >No. It's accessed so frequently that switching from macros to accessor
> >functions would be a ridiculous performance hit, I think.
>
> The last time this came up, the consensus was that a macro should be
> converted to a function, even when it resulted in a performance loss
> (things were a bit vague on how much). The debate was about STREQ which
> is in the critical path for symbol table reading and the like.

STREQ is an entirely different problem, IMHO. For one thing, compilers
do a pretty good job of strcmp on their own; for another, the function
call is heavily optimized.

> Anyway, I tend to look at it more pragmatically. Is my (your, and other
> developers) time best spent chasing after people that forget to or
> wrongly use the accessor macro, or, on fixing real problems. Given that
> I'm struggling to show a performance gain from a frame based register
> cache, and no one has noticed me adding another assertion to every
> gdbarch accessor function, I don't expect changing the above to opaque
> to be a significant problem :-)

I think you may be underestimating the frequency of some of the TYPE
accessors... but if I get a chance, I'll benchmark it.

--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer