Huge increase in UT compile time

Joakim dlang at joakim.fea.st
Sat Oct 14 09:03:05 UTC 2017


On Saturday, 14 October 2017 at 04:36:25 UTC, Saurabh Das wrote:
> On Wednesday, 11 October 2017 at 08:11:37 UTC, Jonathan M Davis 
> wrote:
>> On Wednesday, October 11, 2017 06:25:19 Dhananjay via 
>> Digitalmars-d-learn wrote:
>>> Hello,
>>>
>>> I am upgrading to DMD 2.076.1 from DMD 2.069.2 (similar 
>>> results on 2.075.1), and seeing a huge increase in unittest 
>>> compilation time when the -deps parameter is also passed to 
>>> dmd. This is on both OSX and linux. What can be the cause of 
>>> this?
>>
>> Well, that's a pretty big version jump. So, a lot could have 
>> changed. One thing that comes to mind would be that imports 
>> were overhauled pretty thoroughly to try and fix various 
>> import bugs. This blog article talks about some of that:
>>
>> http://www.schveiguy.com/blog/2016/03/import-changes-in-d-2-071/
>>
>> Or the change could be the result of something else entirely. 
>> Figuring it out would likely require doing a fair bit of 
>> debugging to narrow down when the change happened (and that's 
>> assuming that it's caused by a single commit or small set of 
>> commits rather than simply getting worse over time due to a 
>> variety of factors).
>>
>> - Jonathan M Davis
>
> The following observations (for the above test program) were 
> recorded on Mac OS X 10.11.6:
>
> DMD64 D Compiler v2.073.1
> real    0m0.091s
> user    0m0.067s
> sys 0m0.020s
>
> DMD64 D Compiler v2.074.0
> real    0m0.105s
> user    0m0.072s
> sys 0m0.022s
>
> DMD64 D Compiler v2.075.1
> real    0m44.932s
> user    0m35.732s
> sys 0m7.098s
>
> DMD64 D Compiler v2.076.1
> real    0m46.833s
> user    0m37.827s
> sys 0m7.254s
>
> Furthermore, 2.075.1 gave a bunch of deprecation warnings in 
> std/string.d. The -de switch had to be removed before running.
>
> Hope this helps,
> Saurabh

I can reproduce on linux/x64, looks like a memory leak, as dmd 
balloons out to eat up all available memory until it's killed.  I 
see it with this minimal command passed to dmd 2.075.1, but not 
the 2.074.1 frontend, as reported:

./dmd2/linux/bin64/dmd -c -o- foo.d -unittest -deps=foo.deps

The closest issue I was able to find in bugzilla is this one, but 
that says it goes away with -o-, not the case here:

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

I suggest one of you file a bug with the minimal command, noting 
that it goes away if -unittest or -deps is not passed.  Make sure 
you mark it as a regression, just like the above bug, as Walter 
pays special attention to those.


More information about the Digitalmars-d-learn mailing list