Operations with numbers look slow

I'm trying to figure out how quickly I can invert a large matrix through numpy and run into a rather strange puzzle. The test code is very simple:

invert.py file
from numpy.linalg import inv import time def invert(): a=np.random.rand(10000,10000) s = time.time() b=inv(a) print time.time()-s 

I use a Windows machine to run this test either through the Windows command line or through something like cygwin. The commands I use are the same in both cases:

 python import invert invert.invert() 

However, when I issue the command from the win command line, I get the elapsed time ~ 30 seconds. When I do this through cygwin, I get the elapsed time ~ 1700 seconds! I am also trying to run the same test on a node (linux) cluster and get very slow results (~ 1600 seconds). I am completely confused by this. Issuing the same python commands from the command line is much faster than issuing them through cygwin. It makes no sense to me. Can someone shed some light on why this might happen?

Thanks,

+6
source share
1 answer

Thanks for answers. Although I did not quite understand why this was happening, Craig's answer was useful. When I give the numpy.show_config () command from win cmd, I get information about the blas and lapack libraries. However, when I give the same command from cygwin, I do not get this information. I can only assume that running python through cygwin somehow does not know where the libraries are.

+1
source

All Articles