[Numpy-discussion] tofile speed

Lars Friedrich lfriedri@imtek...
Wed Jul 25 04:58:09 CDT 2007


Hello,

I tried the following:


####### start code

a = N.random.rand(1000000)

myFile = file('test.bin', 'wb')

for i in range(100):
	a.tofile(myFile)

myFile.close()

####### end code


And this gives roughly 50 MB/s on my office-machine but only 6.5 MB/s on 
the machine that I was reporting about.

Both computers use Python 2.4.3 with enthought 1.0.0 and numpy 1.0.1

So I think I will go and check the harddisk-drivers. array.tofile does 
not seem to be the problem and actually seems to be very fast. Any other 
recommendations?

Thanks
Lars


More information about the Numpy-discussion mailing list