Bug 15323 – Module.members and .deferred3 should use data structure with fast lookup
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-11-12T21:05:00Z
Last change time
2016-10-01T11:46:19Z
Assigned to
nobody
Creator
code
Comments
Comment #0 by code — 2015-11-12T21:05:07Z
On a moderately sized build (yes, per-package), iterating Module::members and Module::deferred3 over and over again to check whether they already contain a given template instance takes up a noticeable amount of time (about 5% and 3% of the total compilation time).
The arrays should probably be replaced by a structure with sub-linear lookup for an easy compile-time win in template-heavy projects.
A better solution is have the template instance contain a field which has a pointer to which members[] it is contained in (since it is never contained in more than one).