How to get consistent results when compare speed of numpy.save and h5py?
问题 I'm trying to compare the speed efficiency of two tools that would allow to save 2 GB of numpy array to disk into a file : numpy.save and h5py.create_dataset . (Note : this is just a first test, the real case I have to deal with, is several thousands of numpy arrays of size between 1 and 2 MB, ie several GB at the end) Here is the code I use for doing the benchmark. The problem is that the results are really inconsistent : import numpy as np import h5py import time def writemem(): myarray =