The “load” and “save” functions run very slowly?
조회 수: 38 (최근 30일)
이전 댓글 표시
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
Dmitry Kaplan
2021년 7월 21일
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.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!