Hdf5 vs Cpickle

Source: Internet
Author: User

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)


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.