Performance issue (CPU usage)
6 views (last 30 days)
Show older comments
The matlab i'm using is 2010a.
1. I start up a .m file, but find the CPU cost is too low, only 1% on average in windows task manager. Is there any method to speed up it?
2. What is the difference in terms of performance between running a script by typing the file name in command window and running it by click ctrl+enter?
0 Comments
Answers (2)
Jason Ross
on 29 Mar 2012
It is entirely speculative without seeing what's going on in your code. The condition that springs to mind immediately would be that you are loading data from a (slow) remote file server and you are waiting on the load to complete.
5 Comments
Jason Ross
on 30 Mar 2012
Pulling 2 GB from local disk shouldn't take too much time. I'm making an assumption that you have a reasonably modern drive interface in a system with 90+ GB of RAM, as well as some quick storage.
Are you processing the data in some way as you are loading it? Perhaps you could tell us how you are loading it (post the code). I know there are some people on here who have a lot of experience with the various means of importing data, there are some that can be quicker than others, but there are trade-offs.
Jason Ross
on 30 Mar 2012
Also, what's the time delay we are talking about? Seconds? Minutes? Hours?
Geoff
on 30 Mar 2012
You have over 90GB of RAM???? Do you mean disk space? How much RAM do you actually have?
I would say if you're running a 32-bit MatLab or if you have less than 3 or 4 GB RAM, then your dataset will be paged into virtual memory.
If the processing you do on that data involves a lot of random access you could be page-faulting furiously. The processor will do almost nothing and your disk will be going nuts.
Bring up the Task Manager, show processes and highlight MatLab. Click View -> Select Columns, then make sure "Page Faults" is checked. Run your script and watch the Page Faults. If that number is climbing rapidly, it will indicate a lack of physical memory.
3 Comments
Geoff
on 1 Apr 2012
I assume you are running a 64-bit operating system AND 64-bit MatLab? What is the output of the command 'memory' when you enter it into the command window in MatLab?
Image Analyst
on 1 Apr 2012
It IS possible -- On some Dell workstations you can add 96 GB or even "192GB, DDR3 RDIMM Memory, 1066MHz, ECC (12 DIMMS) [add $23,720.00]" A bit out of my price range or need.
See Also
Categories
Find more on MATLAB Parallel Server in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!