From: Vincent on
"Claudio Pedrazzi" <firstnameinitial.lastname(a)company.it> wrote in message <hm3a3u$718$1(a)fred.mathworks.com>...
> I am concerned about two things:
> 1) speed of execution (local copy vs. network copy)
> 2) uniqueness of code (I have no software management system)
>
> I hoped to hear from the experts that the code will be loaded in memory at the beginning of the execution, and then the performance would be independent of physical storage of the .m file.
>

Hello Claudio,

I am (unfortunately) no expert in Matlab but I would like to comment from my experience as user since I am in a similar situation with all my m-files stored in a network directory. Although I have never compared the execution speed in case of the m-files being locally saved, I often implement changes in the files while they are still being executed and this neither interrupts the execution nor changes the output. In my opinion this shows that Matlab loads the m-file only once.

Best regards,
Vincent
From: Jan Simon on
Dear Vincent, dear Claudio!

> In my opinion this shows that Matlab loads the m-file only once.

Correct! You have to call "CLEAR <FuncName>" to reload a function explicitely.
With MLOCK you can even protect the M-files from being cleared from the memory by CLEAR.

So loading the M-file the first time can be really slow - this matters if you load 1000 M-files and the program runs for 1 second only. If your program runs for hours, the location in the network cannot be noticed.

Good luck, Jan
From: EBS on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <hm45nl$igq$1(a)fred.mathworks.com>...
> Dear Vincent, dear Claudio!
>
> > In my opinion this shows that Matlab loads the m-file only once.
>
> Correct! You have to call "CLEAR <FuncName>" to reload a function explicitely.
> With MLOCK you can even protect the M-files from being cleared from the memory by CLEAR.
>
> So loading the M-file the first time can be really slow - this matters if you load 1000 M-files and the program runs for 1 second only. If your program runs for hours, the location in the network cannot be noticed.
>
> Good luck, Jan

I think that what a lot of people don't realize is that 'clear all' in addition to clearing variables also unloads all M-files from memory, forcing them to be reparsed/compiled the next time they are run which takes extra time. 99% of the time that I see people use 'clear all', they should be really calling 'clear' instead. Also, 'clear classes' does the same thing, but people don't tend to abuse it in the same way as 'clear all'.
From: Claudio Pedrazzi on
Well, I just wish to thank everyone for his/her contribution. In the meantime I run a test, about 2 hours 1/2 long, and could notice absolutely no difference between the two solutions, so this confirms the answers that I have got.

Concerning the open source or free software management systems, if the user that suggested me to get one could kindly quote some names, maybe the most known or most easy for entry level user, I would be very grateful!

Best regards
Claudio