Thread overview
Why Is D So Slow?
May 25, 2018
Kaleb McKinney
May 25, 2018
bachmeier
May 25, 2018
Kaleb McKinney
May 25, 2018
rikki cattermole
May 25, 2018
Kagamin
May 26, 2018
Jacob Carlborg
May 25, 2018
Jonathan M Davis
May 25, 2018
Kaleb McKinney
May 25, 2018
I began learning D to get a performance upgrade from Python for performance reliant applications, and I was disappointed to find that a basic "Hello, World!" program takes almost 8 seconds to run, where in Python, it only took about a tenth of a second. Why is it so slow?
May 25, 2018
On Friday, 25 May 2018 at 00:35:43 UTC, Kaleb McKinney wrote:
> I began learning D to get a performance upgrade from Python for performance reliant applications, and I was disappointed to find that a basic "Hello, World!" program takes almost 8 seconds to run, where in Python, it only took about a tenth of a second. Why is it so slow?

If you're on Windows, it's probably an antivirus issue.
May 24, 2018
On Friday, May 25, 2018 00:35:43 Kaleb McKinney via Digitalmars-d wrote:
> I began learning D to get a performance upgrade from Python for performance reliant applications, and I was disappointed to find that a basic "Hello, World!" program takes almost 8 seconds to run, where in Python, it only took about a tenth of a second. Why is it so slow?

The only time that I've heard of anything like that was when the person was on Windows, and their antivirus was scanning the program every time they started it.

https://forum.dlang.org/post/kihdnggkyicbaczncdhr@forum.dlang.org

- Jonathan M Davis

May 25, 2018
On Friday, 25 May 2018 at 00:40:55 UTC, bachmeier wrote:
> On Friday, 25 May 2018 at 00:35:43 UTC, Kaleb McKinney wrote:
>> I began learning D to get a performance upgrade from Python for performance reliant applications, and I was disappointed to find that a basic "Hello, World!" program takes almost 8 seconds to run, where in Python, it only took about a tenth of a second. Why is it so slow?
>
> If you're on Windows, it's probably an antivirus issue.

What would the antivirus be doing to slow it down?
May 25, 2018
On Friday, 25 May 2018 at 00:47:00 UTC, Jonathan M Davis wrote:
> On Friday, May 25, 2018 00:35:43 Kaleb McKinney via Digitalmars-d wrote:
>> I began learning D to get a performance upgrade from Python for performance reliant applications, and I was disappointed to find that a basic "Hello, World!" program takes almost 8 seconds to run, where in Python, it only took about a tenth of a second. Why is it so slow?
>
> The only time that I've heard of anything like that was when the person was on Windows, and their antivirus was scanning the program every time they started it.
>
> https://forum.dlang.org/post/kihdnggkyicbaczncdhr@forum.dlang.org
>
> - Jonathan M Davis

Thanks! Doing that cut my program's run time from 16 seconds to 1 second!
May 25, 2018
On 25/05/2018 1:11 PM, Kaleb McKinney wrote:
> On Friday, 25 May 2018 at 00:40:55 UTC, bachmeier wrote:
>> On Friday, 25 May 2018 at 00:35:43 UTC, Kaleb McKinney wrote:
>>> I began learning D to get a performance upgrade from Python for performance reliant applications, and I was disappointed to find that a basic "Hello, World!" program takes almost 8 seconds to run, where in Python, it only took about a tenth of a second. Why is it so slow?
>>
>> If you're on Windows, it's probably an antivirus issue.
> 
> What would the antivirus be doing to slow it down?

Scanning it, monitoring it.

Like any good antivirus should be doing.

Add an exclusion path for your projects directory (and toolchains too), it'll save you a lot of trouble down the road.
May 25, 2018
On Friday, 25 May 2018 at 01:11:38 UTC, Kaleb McKinney wrote:
> What would the antivirus be doing to slow it down?

One approach to behavioral detection is when the antivirus has an emulator that executes the analyzed program to see if it will do something nasty. Viruses are usually not written in python, so this emulation can be skipped for python programs.
May 26, 2018
On 2018-05-25 18:05, Kagamin wrote:

> One approach to behavioral detection is when the antivirus has an emulator that executes the analyzed program to see if it will do something nasty. Viruses are usually not written in python, so this emulation can be skipped for python programs.

I'm guessing for Python it has scanned the interpreter once at some point. It doesn't need to be re-scanned since it rarely changes. While a native application changes every time it's built.

-- 
/Jacob Carlborg