This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Speedup lookup_attribute a little


When looking into PR 18687 and how to speed it up, I noticed that
lookup_attribute was a large potion of the compile time.
This removes most of the compile time related to lookup_attribute.
We were calling strlen over and over on a string and we were calling
strlen on a IDENTIFIER which is just wrong when we can get the length
of the IDENTIFIER without that.  This patch fixes those two problems.

OK? Bootstrapped and tested on ppc-darwin with no regressions.

Thanks,
Andrew Pinski

ChangeLog:
	* tree.c (is_attribute_p): Split out to ..
	(is_attribute_with_length_p): Here.  Use IDENTIFIER_LENGTH instead
	of strlen and compare the string lengths before calling strcmp.
	(lookup_attribute): Call is_attribute_with_length_p instead of
	is_attribute_p.


Attachment: speedupAttribute.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]