How can I use speed up Matlab?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a large program with a plenty of data and whenever I run Matlab on my program it takes a lot to do it. I checked my CPU usage in windows task bar manager. It never gets over 50 percent and stays something around 50%, sometimes 51 or 49% . I think I can speed up Matlab calculating by let it have 90 or 95 percent of my CPU usage. I don't know how can I set this property on Matlab and my PC.
Note: I'm using windows vista on LG laptop.
2 Kommentare
Walter Roberson
am 26 Apr. 2013
Do you happen to have a dual core processor?
What kind of processing are you doing? Are you using vectorization a lot on large matrices? Which MATLAB release are you using?
Antworten (2)
Jason Ross
am 26 Apr. 2013
If your CPU uses hyper-threading, the OS is reporting the number of virtual cores, which are typically twice the number of execution cores. Math operations will require the execution cores and will therefore look as if the system is only half busy.
If you turn off hyper-threading in the BIOS, I bet your CPU utilization climbs to the percentage you want, although the execution time of your code will likely stay the same.
0 Kommentare
Walter Roberson
am 26 Apr. 2013
Your CPU percentage might reflect that only one of your two cores is engaged in the work. In certain cases, MATLAB will automatically use multiple cores even if the user does not have the Parallel Computing Toolkit, but those cases are based upon doing mathematical operations on large vectors or arrays (usually around 9000 or more elements.)
I cannot determine at the moment whether your task would be suitable for parallel processing even if you had the Parallel Computing Toolkit, but it might be.
You should profile your code to determine where the bottlenecks are. You should ensure that you pre-allocate your matrices when computationally practical. These are unlikely not engage the second core automatically, but they have the potential for improving the efficiency of your single-core computation.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Performance Profiling finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!