[PATCH] Speedup lookup_attribute a little
Andrew Pinski
pinskia@physics.uc.edu
Thu Dec 2 15:25:00 GMT 2004
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.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: speedupAttribute.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20041202/537fbb1d/attachment.txt>
More information about the Gcc-patches
mailing list