HDF5 loading a 98M file: 0.087s
Cpickle loading a 50M file: 7.6s
87 times times. It's a very powerful look.
HDF5 loading a 8G file: 52.278s
Cpickle loading a 4G file: 643.07s
12.3 times times. It's a good enough.
Or suggest that you use HDF5.
Please note that when you compress, the best choice for the picture format is uint8. Otherwise it will be very large, such as my file, with Cpcikle compression is 50M, the result of the default is not the choice of the format directly to the 99M, but the choice of uint8, it was compressed to 24M, very powerful yo, haha
This is what I use:
Out_file=h5py. File (' e:/temp/%s_%s.h5 '% (video_name[3:],event_name), ' W ')
out_file.create_dataset (' pic ', Data=sample_ Container
Import NumPy as NP
import h5py
begain_t=time.time ()
file=h5py. File (' E:/pure_pos/20071101_e1_cam1_pointing.h5 ', ' R ')
data=file[' pic ' [:]
print len (data[1])
print '% F '% (Time.time ()-begain_t)