Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: slow repetitive loading of .MAT file save in -v6 format
Replies: 3   Last Post: Jun 23, 2014 4:40 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Yair Altman

Posts: 1,349
Registered: 3/19/07
Re: slow repetitive loading of .MAT file save in -v6 format
Posted: Jun 23, 2014 3:18 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Teh " <jiashenteh@hotmail.com> wrote in message <lo9r4s$iou$1@newscl01ah.mathworks.com>...
> Dear Users,
>
> I have saved all my .MAT files (24231 of them) using -v6 format. Hence, the saving part is very fast with less than 1s.
>
> When I load these files individually without loading them 1 by 1 using for loop, it takes less than 1s as well.
>
> The problem comes when I try to load these MAT files one by one in a loop manner.
> for example
>
> for i = 1:24231
> load(num2str(i).mat);
> end
>
> The first load at i = 1 is less than 1s, but from i = 2 onwards, the loading time becomes consistently slow at 7s.
>
> May I know why?



Possibly because each file load() needs to deallocate and reallocate memory for the same variables, or possibly because you're running out of physical memory and the OS is using virtual (swap) memory for allocating new data.

Yair Altman
http://UndocumentedMatlab.com




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.