Why Would an m-file run quickly but publishing it runs slowly?
Ältere Kommentare anzeigen
I have created a relatively short m-file that runs completely in ~10 seconds and produces the output I expect (couple of plots). However, publishing it to either a pdf or html causes it to slowdown. Very slow. It takes about 20 minutes to publish.
Are there particular functions I should look out for? I'm confused since it obviously solves very quickly.
This will probably require some discourse since I'm not going to post my code here (yet). This is a homework assignment and I don't want to post this online until it's due (later this week), so there is the ability to discuss it then.
1 Kommentar
Walter Roberson
am 19 Sep. 2012
Possibly you are publishing at much higher resolution ?
Antworten (1)
Ken Atwell
am 19 Sep. 2012
0 Stimmen
We'd need the code to be sure, but I'll guess that publishing is causing the JIT to not kick in some situation when normally it would kick in when running freely.
Bracketing each block of code with tic/toc will narrow down the culprit, and then maybe you can share just that one subsection here on Answers.
2 Kommentare
Ken Atwell
am 19 Sep. 2012
Turn all three "%%"'s into just "%". I believe publishing will pause to gather state whenever it encounters a "%%", so don't do this within your loop.
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!