Python Forum
windows defender slows python first time ran
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
windows defender slows python first time ran
#1
im going to link this discussion because i am curious of the fix to it.
https://www.reddit.com/r/pygame/comments...s_forever/

summary:
a simple hello world program in python is slow (60) seconds to run the first time, but afterwords runs fast. But after the computer rests for a few hours, or even reboots, goes slow again. Doesnt seem to be just pygame issue, but numerous python modules. A temp fix seems to be adding the python module to windows defender exclusions.


I have never had this issue but i often hear of people that do. Why is windows defender flagging that and what is the proper way to fix it?
Recommended Tutorials:
Reply
#2
Quote:after the computer rests for a few hours, or even reboots, goes slow again
Do you think there may be a cache that gets loaded and then stays around for a while until the garbage collecter finally deletes it?
this would allow it to run fast while the cache is still available, and accounts for slow start later (after cache was garbage collected).
Reply
#3
I'm not surprised. Anti-virus programs do not like interpreted languages. When they installed Kaspersky at work it completely shut down our ability to run SAS programs. We had to move the temporary folder SAS uses off of our C drives and onto the network, which allowed us to run programs, but slowed them down.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#4
I'll start by saying I've never had this problem with Python or any program, though I don't have Pygame installed. My initial question would be is this a laptop or desktop, which might point towards the power settings. Not likely though since he mentions it happens after reboot, at which point the power settings should not have kicked in yet. My next thought, was as Larz suggested was a cache problem. Since the OP states it's definitely a Windows Defender issue, then I'd have to ask if the default setting is for "Quick Scan" or "Deep Scan". As I said, I've not had the problem but don't have Pygame. The OP says he doesn't remember how he installed Python and nobody asked how he installed Pygame, but my final thought is not a problem with Windows Defender, but rather Python or more likely Pygame which is causing Defender to take a very close look at that directory. He could also check Defenders history and Windows error logs to see if they shed any light on the matter. It's hard to diagnose a problem when you don't have "hands-on" because you are relying 100% on the person telling you the truth about what they did and you know they did something, otherwise the problem would be a lot more prevalent.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020