Why is starting python under Windows 10 so incredibly slow, and how to speed this up

Viewed 1058

I've been using Python for 20 years on Windows, Linux and, lately, on OsX. However since MS forced me to switch from Windows 8 to Windows 10, the time required for the first run of a Python program has gone from a fraction of a second to 5-10 seconds on my 32 GB Quadcore.

Anyone knows what causes this and how to make it fast again?

1 Answers

For me the time waster is all the imports. If you have any packages that are installed with -e they are especially slow to load. To measure the time, you can do this...

import time
t0=time.time()

# put all your imports here
import numpy as np 
import logging
import mystuff

print('IMPORT TIME =', time.time()-t0)
Related