The “load” and “save” functions run very slowly?

33 views (last 30 days)
The “load” and “save” functions run very slowly?
When I load a mat file with a size of nearly 2G, it is very slow. It takes about ten seconds to get into memory. Save is also slow. Can Mathworks provide performance for these 2 functions?
my envs:
os: windows10
memery:16G
card: nvidia 1070-8G
matlab:r2020a
cpu: i7-6700 ,8-cores
  4 Comments
Dmitry Kaplan
Dmitry Kaplan on 21 Jul 2021
Consider yourself lucky. Saving a 2.2G table with -v7.3 takes 21 minutes, basically rendering the save() command useless. There are workarounds, but they are truly ugly.
Why is Matlab so lame with this? Good question. Serialization of tables, especially to files doesn't seem to be Matlab's programmers' strong suite (just try displaying a long table -- it can take a minute for Matlab to collect its thoughts before any output appears). Additionally, 7.3-style files are more complex and writing them takes longer in general. It is a pity that parallel toolbox's presence doesn't seem to help. I hope it will get better eventually.
If your datatype supports it, fwrite()/fread() are much faster.

Sign in to comment.

Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!