필터 지우기
필터 지우기

WAAAAYY slow loading objects

조회 수: 7 (최근 30일)
Trevor Harris
Trevor Harris 2017년 12월 7일
댓글: Adam 2017년 12월 7일
Hey all,
I have a class in Matlab which contains a variety of data. The saving of this data is reasonably fast, but the loading is obscenely long. I've just loaded a 15.7mb instance of the class and it took 504 seconds.
The object is like a table that contains strings and other classes, of which are made up of strings and doubles. I make no delusion that its a lot of information cascaded within. However, I have completed other testing. I have a function that converts the file into base matlab (so other users can read my data). This strips all the "class" info and saves all the data in a struct containing strings and doubles as appropriate. I save this file and it ends up being 20.4mb, and I can load this in 0.275498 seconds.
I have no problem creating a custom loader for my class, that's not a problem, but I don't even know where to begin with this. Am I missing something fundamental here?
I'd also like to point out that I was not having this issue at all in 2012 matlab. I'm using the same code now in 2017 and am noticing dramatic performance differences.
  댓글 수: 3
Trevor Harris
Trevor Harris 2017년 12월 7일
Hey Adam,
Below is an example of my load and save lines. The variable I'm saving is called tb.
save([saveDir, fileName, '.nrc'],'tb','-v7.3')
load([saveDir, fileName, '.nrc'],'-mat')
Adam
Adam 2017년 12월 7일
Try saving using v7 instead and see if it makes any difference. v7.3 seems to not be good at all in many situations, though in my case when I was using it I was saving a huge .mat file where saving took > 40 minutes as well as loading so may be a different issue anyway.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by