WAAAAYY slow loading objects

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 件のコメント

Adam
Adam 2017 年 12 月 7 日
What are you saving as? .mat file? If so what version are you saving as?
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 件)

カテゴリ

ヘルプ センター および File ExchangeWorkspace Variables and MAT Files についてさらに検索

質問済み:

2017 年 12 月 7 日

コメント済み:

2017 年 12 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by