Python is very slow to start on Windows 7

Mike

Python takes 17 times longer to load on my Windows 7 machine than Ubuntu 14.04 running on a VM (inside Windows on the same hardware). Anaconda3 distribution is used on Windows and Ubuntu default python3.4.

From a Bash prompt (Git bash on Windows):

$ time python3 -c "pass"

returns in 0.614s on Windows and 0.036s on Linux

When packages are loaded the situation gets worse:

$ time python3 -c "import matplotlib"

returns in 6.01s on Windows and 0.189s on Linux

Spyder takes a whopping 51s to load on Windows and 1.5s on Linux.

I have not had any luck determining why I have this performance problems. Does anyone have any ideas what I should try next?

edit:

Why is python so much slower on windows? has been suggested as a possible duplicate but my performance different is far greater and not explained simply by different library dependencies and compilers. This seems to me to be related to filesystem differences.

I had suspected antivirus on-access scans but disabled the antivirus just in case.

>>> sys.path

['', 'c:\\Anaconda3\\python34.zip', 'c:\\Anaconda3\\DLLs', 'c:\\Anaconda3\\lib', 'c:\\Anaconda3', 'c:\\Anaconda3\\lib\\site-packages', 'c:\\Anaconda3\\lib\\site-packages\\Sphinx-1.2.3-py3.4.egg', 'c:\\Anaconda3\\lib\\site-packages\\cryptography-0.8-py3.4-win-amd64.egg', 'c:\\Anaconda3\\lib\\site-packages\\nose-1.3.4-py3.4.egg', 'c:\\Anaconda3\\lib\\site-packages\\win32', 'c:\\Anaconda3\\lib\\site-packages\\win32\\lib', 'c:\\Anaconda3\\lib\\site-packages\\Pythonwin', 'c:\\Anaconda3\\lib\\site-packages\\setuptools-14.3-py3.4.egg']

Update:

A fresh install of Windows 8.1 Pro on the same PC solved the problem. After reinstalling all applications and Anaconda3 Python performance is the best I have seen. Unfortunately the root cause of this issue is still unknown.

Correction:

After my IT dept installed Sophos SafeGuard encryption software and MS Endpoint Protection the problem returned. Same slow start as before. Disabling the extra software did not solve the problem so we are trying tests on other machines to trace the problem.

Mike

The problem is solved by uninstalling Sophos SafeGuard. This is not really a satisfactory solution though since my company uses this filesystem encryption software on directories that I access daily. I have not seem any other performance problems except with Python (and apparently Ruby as well).

NOTE: Sophos SafeGuard is not antivirus software. It is an enterprise filesystem encryption system. The strange thing is that encryption is explicitly not enabled for local filesystems, such as where Python is installed.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Start Menu search is very slow in Windows 8.1

From Dev

Very Slow Boot Time Windows 7 with SSD

From Dev

Installing software on Windows 7 very slow

From Dev

Windows 7 is very slow opening some directories

From Dev

Teamcity start very slow

From Dev

Windows 8 Start Screen very slow after Guest Additions

From Dev

Windows 7 very slow to startup and restore from hibernate

From Dev

Frozen Python Application with cx_Freeze is very slow to start

From Dev

Very very slow transfer speeds between Windows 7 and samba server running on Ubuntu 11.10/12.04 minimal

From Dev

Python virtualenv is very slow

From Dev

Drupal-7 website is very very slow

From Dev

How to diagnose slow (only for awhile after start) Windows 7 machine?

From Dev

Windows Update downloads are very slow

From Dev

Windows 8 boot is very slow

From Dev

Some applications on Ubuntu 19.10 very slow to start

From Dev

Python numpy performing very slow

From Dev

Python: Very slow execution loops

From Dev

Python: Very slow execution loops

From Dev

Wifi is fine on Ubuntu but very slow on window 7

From Dev

Wifi is fine on Ubuntu but very slow on window 7

From Dev

Rails Windows Vagrant very slow response time

From Dev

Windows Azure Caching (Preview) Very Slow

From Dev

Jenkins (Windows) very slow Git fetch

From Dev

SQLite SELECT very slow on Windows Phone

From Dev

Windows is very slow with my new SSD

From Dev

Cygwin from Windows is very slow/ laggy

From Dev

Windows Boot Manager works very slow

From Dev

Very slow WiFi speeds on Windows 8

From Dev

Rails Windows Vagrant very slow response time