Bug 15093 – optimize slist_reset

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-09-21T15:36:32Z
Last change time
2024-12-13T18:44:52Z
Assigned to
No Owner
Creator
Martin Nowak
Moved to GitHub: dmd#19047 →

Comments

Comment #0 by code — 2015-09-21T15:36:32Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19047 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB