www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Horrible DMD startup performance on Windows

reply Bruno Medeiros <bruno.do.medeiros+dng gmail.com> writes:
I dunno if this was discussed already (I couldn't find any other thread) 
- but ever since DMD was ported to D, the startup performance on Windows 
has become horrible. Takes over 3 seconds on my machine just to display 
the version.

```
$ time ./dmd.exe --version
DMD32 D Compiler v2.071.0
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright

real    0m3.312s
user    0m0.000s
sys     0m0.015s
```

On Linux (even under a VM), it's instantaneous. LDC is instantaneous 
too. Is this a bug or some architectural/backend limitation of DMD on 
Windows?

-- 
Bruno Medeiros
https://twitter.com/brunodomedeiros
May 31 2016
parent reply Martin Krejcirik <mk-junk i-line.cz> writes:
On Tuesday, 31 May 2016 at 18:13:05 UTC, Bruno Medeiros wrote:
 performance on Windows has become horrible. Takes over 3 
 seconds on my machine just to display the version.
Doesn't happen to me. I doubt the problem is in dmd itself. Maybe deep path search, antivirus, or something like that ?
May 31 2016
parent reply Bruno Medeiros <bruno.do.medeiros+dng gmail.com> writes:
On 31/05/2016 19:21, Martin Krejcirik wrote:
 On Tuesday, 31 May 2016 at 18:13:05 UTC, Bruno Medeiros wrote:
 performance on Windows has become horrible. Takes over 3 seconds on my
 machine just to display the version.
Doesn't happen to me. I doubt the problem is in dmd itself. Maybe deep path search, antivirus, or something like that ?
Hum, I didn't suspect anti-virus because DMD 2.068 (a version before the port to D) works fine. However it turns out that indeed anti-virus is the problem. My laptop is on Windows 7 and if I turn off real-time protection on Microsoft Security Essentials, DMD starts instantaneously. -- Bruno Medeiros https://twitter.com/brunodomedeiros
May 31 2016
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/31/16 2:34 PM, Bruno Medeiros wrote:
 On 31/05/2016 19:21, Martin Krejcirik wrote:
 On Tuesday, 31 May 2016 at 18:13:05 UTC, Bruno Medeiros wrote:
 performance on Windows has become horrible. Takes over 3 seconds on my
 machine just to display the version.
Doesn't happen to me. I doubt the problem is in dmd itself. Maybe deep path search, antivirus, or something like that ?
Hum, I didn't suspect anti-virus because DMD 2.068 (a version before the port to D) works fine. However it turns out that indeed anti-virus is the problem. My laptop is on Windows 7 and if I turn off real-time protection on Microsoft Security Essentials, DMD starts instantaneously.
I wonder how we can sign dmd to prevent a scan with every run. Any experts in the matter n da house? -- Andrei
May 31 2016
parent reply Bruno Medeiros <bruno.do.medeiros+dng gmail.com> writes:
On 31/05/2016 19:37, Andrei Alexandrescu wrote:
 On 5/31/16 2:34 PM, Bruno Medeiros wrote:
 On 31/05/2016 19:21, Martin Krejcirik wrote:
 On Tuesday, 31 May 2016 at 18:13:05 UTC, Bruno Medeiros wrote:
 performance on Windows has become horrible. Takes over 3 seconds on my
 machine just to display the version.
Doesn't happen to me. I doubt the problem is in dmd itself. Maybe deep path search, antivirus, or something like that ?
Hum, I didn't suspect anti-virus because DMD 2.068 (a version before the port to D) works fine. However it turns out that indeed anti-virus is the problem. My laptop is on Windows 7 and if I turn off real-time protection on Microsoft Security Essentials, DMD starts instantaneously.
I wonder how we can sign dmd to prevent a scan with every run. Any experts in the matter n da house? -- Andrei
The user can add entries to a list of files/folders that are excluded from the MSE scan. So that's a workaround. But yes, better if it would work out-of-the-box, especially for users who might not be aware the slowdown is due to anti-virus check. Also, an important follow-up is: could this be affecting other DMD-generated programs? -- Bruno Medeiros https://twitter.com/brunodomedeiros
May 31 2016
parent Jacob Carlborg <doob me.com> writes:
On 2016-05-31 20:44, Bruno Medeiros wrote:

 Also, an important follow-up is: could this be affecting other
 DMD-generated programs?
I would guess that's possible now since DMD is written in D and generated with DMD. -- /Jacob Carlborg
May 31 2016