[Issue 15093] optimize slist_reset

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jan 6 10:30:31 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15093

John Colvin <john.loughran.colvin at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john.loughran.colvin at gmail.
                   |                            |com

--- Comment #1 from John Colvin <john.loughran.colvin at gmail.com> ---
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.

--


More information about the Digitalmars-d-bugs mailing list