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]

Re: PATCH: minor C++ front end compile speed improvement



On Dec 1, 2004, at 11:45 AM, Matt Austern wrote:


On Dec 1, 2004, at 10:12 AM, Mark Mitchell wrote:

Matt Austern wrote:
I'm seeing a bit under 0.5% improvement in QT builds from this. (Again: close to the limits of accuracy of my measurements, so take that number with a grain of salt.) We avoid a test and a dereference in namespace_binding when we're looking things up in the global namespace, since we know the global namespace can't be an alias.
OK to commit to mainline?
--Matt

Zack pointed me at this. Yes, this is OK. I'm amazed it helps that much, but profiling is always amazing. Add a comment, please, explaining why it is safe to do this. (Not why it's a performance win; just why it makes sense.)

Done!


And quite possible that the real gain is less than .5%. See note above about salt.

I am also wondering about the .5% gain.
Effectively this patch replaces one branch with another. The net gain is not use of
what is inside body of the macro for global namespace, which doesn't seem that complicated. But if
this sort of optimization is promising, then there could be more similar opportunities elsewhere.


- fariborz

--Matt




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