how to speed up the process

Respuestas (1)

Jan
Jan el 29 de Dic. de 2011

0 votos

At first search for the most time consuming part of the function using the PROFILEr. It would be useless to optimize a part, which takes 0.1% of the processing time.
Then examine the found "bottleneck" and check for a proper pre-allocation, the possibility to use integer types instead of doubles, simplify the contents of loops and avoid all repeated calculations. Finally check if a vectorization could be possible.
Does the algorithm exhaust your RAM? Then installing enough memory can give a speed-up of factor 1000.
Can the problem be parallelized? Then PARFOR might be helpful.
After or before the above steps have been performed, buy a computer with the double speed. Then the computation will take 50% of the time.

4 comentarios

Pat
Pat el 29 de Dic. de 2011
wen my program runs ,it is in busy state ,dont know whether it is running or hanged off,is it possible to show which line it is executing
Walter Roberson
Walter Roberson el 29 de Dic. de 2011
In order to show the line that is executing, you would need to use a timer interrupt that examined dbstack() and printed out that information.
Jan
Jan el 29 de Dic. de 2011
The "echo" command will show the currently processed line. See "help echo". Take into account, that this will slow down the processing dramatically.
Instead of this brute display of every line, you could use "waitbar" or some "disp" statements to show the progess.
Pat
Pat el 30 de Dic. de 2011
OriginalData=xlsread('dataset.xls');
[r c]=size(OriginalData)
k=zeros(r,1);
OriginalData=[OriginalData k];
[ DiscretData,DiscretizationSet1 ] = CACC_Discretization( OriginalData,1);
DiscretizationSet1
this is my program can u please tell where to use those commands to see which line is ececuting

Iniciar sesión para comentar.

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

Pat
el 29 de Dic. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by