Performance issue (CPU usage)

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?

Respuestas (2)

Jason Ross
Jason Ross el 29 de Mzo. de 2012

0 votos

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 comentarios

Jf
Jf el 29 de Mzo. de 2012
Thanks for your reply. The codes don't load data from a remote server, but only load data from local disk, and this loading process will be done at the beginning of the program. The program performs a lot of matrix manipulation. Briefly speeking, it solves an optimization problem by gradient-decent algorithm. So any other potential reasons why the program takes too few CPU usages, and is there a difference between running the codes in command window and by clicking ctrl+enter? Thanks very much,
Jason Ross
Jason Ross el 29 de Mzo. de 2012
How much data is being loaded? How long is the delay? If you put a tic/toc around the load, does that correspond to the delay?
I don't think there will be a difference with control-enter and command line.
Jf
Jf el 30 de Mzo. de 2012
About 2GB data are loaded, and the memory on my server is about 90+GB. Is the delay you mentioned the time of loading the data? Since it loads from the local disk, it doesn't cost much time.
Jason Ross
Jason Ross el 30 de Mzo. de 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
Jason Ross el 30 de Mzo. de 2012
Also, what's the time delay we are talking about? Seconds? Minutes? Hours?

Iniciar sesión para comentar.

Geoff
Geoff el 30 de Mzo. de 2012

0 votos

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 comentarios

Jf
Jf el 30 de Mzo. de 2012
Thanks very much. Yeah, the memory is 90G+, not hard disk. I found there are many phisical memory available, but the number of Page Faults is very high, about 1G+. Enough memory from the 'Phisical memory' at the right-bottom of the task manager, but it appears a lack of memory from 'Page faults'. Too strange. Is there any method to resolve it. Thanks again
Geoff
Geoff el 1 de Abr. de 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
Image Analyst el 1 de Abr. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Parallel Server en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

Jf
el 29 de Mzo. de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by