Thread overview
After compiling Hello World with DMD Compiler, .EXE file takes 1-3 seconds to run for the first time
May 18, 2020
BoQsc
May 18, 2020
Adam D. Ruppe
May 18, 2020
BoQsc
May 18, 2020
kinke
May 18, 2020
Adam D. Ruppe
May 18, 2020
I use Windows 10.
I tried exactly like mentioned here:
http://ddili.org/ders/d.en/hello_world.html

It seems strange that on the first run after D language compilation. Hello World program takes 1-3 seconds to launch.

While C Hello World program simply executes in a second or less.

Why is that, and what can we do about it.
May 18, 2020
On Monday, 18 May 2020 at 15:47:40 UTC, BoQsc wrote:
> It seems strange that on the first run after D language compilation. Hello World program takes 1-3 seconds to launch.

That's the Windows virus scanner again.

It sees D programs as unusual and gives them additional scrutiny...

You can set an exception in the windows virus scanner settings for the folder where you work with D.
May 18, 2020
On Monday, 18 May 2020 at 15:49:06 UTC, Adam D. Ruppe wrote:
> On Monday, 18 May 2020 at 15:47:40 UTC, BoQsc wrote:
>> It seems strange that on the first run after D language compilation. Hello World program takes 1-3 seconds to launch.
>
> That's the Windows virus scanner again.
>
> It sees D programs as unusual and gives them additional scrutiny...
>
> You can set an exception in the windows virus scanner settings for the folder where you work with D.

That's exactly what it was. I disabled the Windows Security Real-Time Protection,
and tested few more times. The execution was immediate.

Thanks Adam.
May 18, 2020
On Monday, 18 May 2020 at 15:49:06 UTC, Adam D. Ruppe wrote:
> It sees D programs as unusual and gives them additional scrutiny...

Is that really the case for all D programs on Windows, or just those built with -m32 and thus using the exotic DigitalMars C runtime?
May 18, 2020
On Monday, 18 May 2020 at 16:01:14 UTC, kinke wrote:
> Is that really the case for all D programs on Windows, or just those built with -m32 and thus using the exotic DigitalMars C runtime?

-m32mscoff does it too, and -m64 has a slight delay as well (though possible that's just a cold disk cache). I don't think it is the runtime per se, I think it is the codegen.

It doesn't do it on ldc on my box, but possible I whitelisted that whole subtree so someone else should check as well.