Bug 13232 – dmd compile times increased by 10-20%

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-31T20:24:00Z
Last change time
2014-08-21T18:22:13Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2014-07-31T20:24:15Z
I see this across all projects that I tested with dmd-2.066.0-rc1. The compile times went up by 10-20% for debug builds when compared with dmd-2.065.0. Maybe we can identify some major causes for this.
Comment #1 by code — 2014-08-01T00:26:07Z
There seems to be a bunch of tiny slowdowns that are hard to identify. I could identify 2 commits though that significantly added to the compile time. Fix issue 12455 [reg]Bad lowercase mapping for 'LATIN CAPITAL LETTER … …I WITH DOT ABOVE' https://github.com/D-Programming-Language/phobos/commit/c131da58341b5af00feedd3dc535f2915cbdae0e Add - SHA-2 https://github.com/D-Programming-Language/phobos/commit/7b368482166470421868aa9ecab95d37f130d374 The problem in both cases seems to be this pattern. ---- module slowdown; alias foo = complicatedTemplate!SomeArgs; ---- When the compiler imports a module with such a declaration it will run complete semantic on the template. First pull for std.uni: https://github.com/D-Programming-Language/phobos/pull/2392 Changing std.digest.sha will be bit more difficult, but we should do it before 2.066 sets the API in stone.
Comment #2 by github-bugzilla — 2014-08-01T14:57:48Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/401b104cf4dfa3920fe7a31585bce1fa04096c66 Issue 13232 - avoid expensive template instantiations on module import - hide std.uni.TrieBuilder instantiations behind functions https://github.com/D-Programming-Language/phobos/commit/fe70d234aee5516ad9c10e4ad1ca22bd1fccc04b Merge pull request #2392 from MartinNowak/fix13232 Issue 13232 - avoid expensive template instantiations on module import
Comment #3 by code — 2014-08-02T04:46:39Z
I did rework std.digest.share, but it's a major code uglification. Instead we should improve the compiler, opened issue 13242.
Comment #4 by bugzilla — 2014-08-02T19:56:12Z
Does the pull mean that we can mark this as resolved?
Comment #5 by code — 2014-08-04T09:27:31Z
In any case, I think it isn't a severe enough regression to hold up the release anymore.
Comment #6 by code — 2014-08-04T19:06:26Z
I'll close this, as speeding up std.digest.sha would have a bad impact on the code quality. We should have an eye on this though, as it's one of D's major selling points, but we're not monitoring it (issue 12949 reports 64% slowdown). I opened issue 13242 and issue 13253 and added them to the Agenda for 2.067 [1], [2]. It's a good chance to get them done, because we already want to work on imports. Maybe we can even tackle lazy import (issue 13255). [1]: http://wiki.dlang.org/Agenda#Faster_compilation [2]: http://wiki.dlang.org/Agenda#Faster_compilation_2
Comment #7 by github-bugzilla — 2014-08-08T05:17:48Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/e8298f5b40857d404beca94a00ed3bc7df1d7bfc Merge pull request #2392 from MartinNowak/fix13232 Issue 13232 - avoid expensive template instantiations on module import
Comment #8 by code — 2014-08-08T12:52:42Z
(In reply to Martin Nowak from comment #6) > We should have an eye on this though, as it's one of D's major selling > points, but we're not monitoring it (issue 12949 reports 64% slowdown). For the record, I'm working on a compile-time/run-time performance tracker that automatically gathers data for DMD/LDC/GDC Git master. The web UI needs a bit more work before it's actually useful, but I hope I'll have something to show around this fall.
Comment #9 by github-bugzilla — 2014-08-21T18:22:13Z