www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Why Is D So Slow?

reply Kaleb McKinney <mckinneykaleb5 gmail.com> writes:
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 24 2018
next sibling parent reply bachmeier <no spam.net> writes:
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
parent reply Kaleb McKinney <mckinneykaleb5 gmail.com> writes:
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 24 2018
next sibling parent rikki cattermole <rikki cattermole.co.nz> writes:
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 24 2018
prev sibling parent reply Kagamin <spam here.lot> writes:
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 25 2018
parent Jacob Carlborg <doob me.com> writes:
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
May 26 2018
prev sibling parent reply Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
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 24 2018
parent Kaleb McKinney <mckinneykaleb5 gmail.com> writes:
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 24 2018