I am trying to see how fast I can invert a large matrix through numpy and am facing a rather weird conundrum. The test code is very simple:
file invert.pyfrom 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 am using a Windows machine so that I can run this test either through the Windows command prompt or through something like cygwin. The commands I use are exactly the same in either case:
python
import invert
invert.invert()
However when I issue the command from the win command prompt I get an elapsed time of ~30 seconds. When I do it through cygwin I get an elapsed time of ~1700 seconds! I am also trying to run the same test on a cluster node (linux) and get very slow results (~1600 seconds). I am quite baffled with this. Issuing the same python commands from the command prompt appears to be working massively faster than issuing them through cygwin. This makes no sense to me. Can someone shed some light on why this may be happening?
Thanks,