This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: speed up compiler a little bit by optimizing loo kup_attribute() and is_attribute_p()
- From: "Nicola Pero" <nicola dot pero at meta-innovation dot com>
- To: "Richard Guenther" <richard dot guenther at gmail dot com>
- Cc: "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>
- Date: Tue, 21 Jun 2011 12:17:34 +0200 (CEST)
- Subject: Re: Patch: speed up compiler a little bit by optimizing loo kup_attribute() and is_attribute_p()
- References: <1308609437.64587569@www2.webmail.us> <BANLkTi=6+PCRrhv1W1AhJTtJoRSRmqw9yg@mail.gmail.com>
>> This patch speeds up the C/C++/ObjC/ObjC++ compiler a little bit by optimizing
>> lookup_attribute() and is_attribute_p(). ÂThe main change is that these functions
>> are now inline.
>
> I don't think this is a good idea.
Can you explain why ? You never do in your response :-)
I'm guessing it's because you think the inline functions are too big and that's
counter-productive ?
> For this case I'd factor out the NULL attribute list check into an
> inline function and keeping the non-NULL attribute list pieces out-of-line.
Ok ... so is this what you'd like - the common, hot case in the inline function,
and the less common, cold case in the out-of-line one ? :-)
That makes sense - I'll try that out tonight (it takes a few hours to run all
the benchmarks). ;-)
> Does it work for all languages? And yes, I agree it would be nice to
> canonicalize to the form without _s even in the attribute lists itself.
> Or go one step further - do not store an identifier but an enum as we
> in fact only ever insert known attributes into the list (which should
> be a VEC instead, possibly even sorted to allow binary search).
Sure ... one step at a time. :-)
Thanks