Why is save/load write/read soooo slooooow?
Show older comments
I used a save myworkspace at a point when I want to interrupt a long process, and sometime later I do a load myworkspace to restore the interrupt point and continue.
The typical mat file produced by this procedure is 18 GB. The save takes 1200 seconds, the load takes 350 seconds. The times are the same using a single HDD or a SSD cluster in Raid0 configuration.
On the same computer I can use the OS to copy a 18 GB file in 65 seconds on HDD, 30 seconds on SSD.
So it appears that Matlab save/load have some serious bottlenecks. Is there anything I can do differently? Is this something I should raise to Mathworks Support?
9 Comments
Ron Abileah
on 8 Sep 2013
Edited: Ron Abileah
on 8 Sep 2013
Walter Roberson
on 8 Sep 2013
"modified" HDF5
Ron Abileah
on 8 Sep 2013
Cedric
on 8 Sep 2013
netCDF and HDF5 are the two major libs/tools for managing large datasets storage/retrieval. They are both supported by MATLAB through sets of low to high level functions:
- http://www.mathworks.com/help/matlab/hdf5-files.html
- http://www.mathworks.com/help/matlab/network-common-data-form.html
From there, you'll have to perform a few tests saving/loading specific variables using regular save/load vs HDF5 functions (vs. netCDF), because I cannot tell you what improvement you'll get specifically with your setup and data. A last option could be to build your own C/MEX export function. But in all cases, I guess that you'll have to work/learn/test quite a bit before you get a real improvement, because nothing is straightforward with 18GB files.
Ron Abileah
on 10 Sep 2013
Cedric
on 12 Sep 2013
I think that even this partial answer will be useful information for the next persons who are facing this issue and who find your thread!
xingxingcui
on 24 Aug 2021
similar questions here, matfile and half inefficient storage
similar questions here, The “load” and “save” functions run very slowly?
Accepted Answer
More Answers (1)
Categories
Find more on HDF5 in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!