On Fri, Mar 28, 2025 at 10:02:28PM -0400, Patrick Palka wrote:
> On Fri, 28 Mar 2025, Jason Merrill wrote:
> 
> > Tested x86_64-pc-linux-gnu, initially with extra checking to make sure that
> > indeed nothing got saved from a namespace level.
> > 
> > This isn't a regression, but a 20% speedup for a simple change is pretty
> > attractive; what do people think about this change for GCC 15?
> > 
> > -- 8< --
> > 
> > Profiling showed that the loop to save away IDENTIFIER_BINDINGs from open
> > binding levels was taking 5% of total compilation time in the PR116285
> > testcase.  This turned out to be because we were unnecessarily trying to do
> > this for namespaces, whose bindings are found through
> > DECL_NAMESPACE_BINDINGS, not IDENTIFIER_BINDING.
> > 
> > As a result we would frequently loop through everything in std::, checking
> > whether it needs to be stored, and never storing anything.
> > 
> > This change actually appears to speed up compilation for the PR116285
> > testcase by ~20%.
> 
> Nice, this also speeds up compilation of stdc++.h by ~20%!  And std
> module compilation by ~10%.  +1

The patch looks good to me too, thanks.

Marek

Reply via email to