Matlab is unpredictably slow
16 次查看(过去 30 天)
显示 更早的评论
Like many other users, I have experienced my code (on occasion) running TEN times slower than it normally does. I have read a fair number of posts about JIT and PCode but cannot determine if this is my problem since I can't reliably reproduce the slow execution! It's a bit maddening. After experiencing the slow performance, I rerun the code & it runs MUCH faster. In order to try & reproduce the slow performance, I tried "clear all" and even restarted Matlab... to no avail! The code runs fine for a while until.... at some point in the future... it becomes slow as molasses again.
Any ideas of how I can reliably reproduce the slow performance so I can attack it? I can't post my code but I should say that it is both memory and disk intensive.
Thanks!
Dan
2 个评论
Stephen23
2016-6-10
编辑:Stephen23
2016-6-11
"Like many other users"
Really, which "many other" users? Can you provide a reference for this?
I know of many cases where MATLAB is predictably slow due to poor code practices or a busy CPU/memory, but I have never heard of "many other users" suffering from unpredictably slow code.
John D'Errico
2016-6-10
Don't go off and use a web browser when you are running MATLAB. Don't have other stuff running in the background. Even if your machine is has multiple cores, this cuts MATLAB's access to the CPUs that it needs.
Don't try to solve too big problems. If you solve marginally large problems, then SOMETIMES you will force MATLAB to use swap space heavily. That causes the code to wait will your disk thrashes. Disk access is far slower than RAM access.
There are other reasons why it MIGHT be slow, many of them a direct function of what you are doing, your problem etc. Since we don't know what you are doing, we cannot guess why you have issues. The crystal ball is so foggy. I bought some crystal ball anti-fogging fluid from an online retailer though, so that may help.
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Install Products 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!