When compiling multilibs a lot of time (sometimes up 8%) is spent in slist_reset.
We should perform resetting of symbols that are used in another object lazily.
One way to implement this would be to use monotonically increasing the symbol numbers (Sxtrnum) and checking whether the numer belongs to the curren object before using a symbol.
Another solution that might already help is to reset the symbols directly after usage.
Comment #1 by john.loughran.colvin — 2016-01-06T18:30:31Z
I did some testing building phobos and slist_reset is a no-op for approx. 99.95% of the symbols it iterates over.
Another possible approach, perhaps a bit complicated/intrusive: hide the reset members of Symbol behind getters/setters, have a global reset counter, with a cache in each Symbol, Symbols reset all relevant members in any getter/setter if the counter is larger than their cached value, then cache the current counter. slist_reset increments the counter.
Comment #2 by robert.schadek — 2024-12-13T18:44:52Z