The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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,407
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 " <> wrote in message <lo9r4s$iou$>...
> 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

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.