how to speed up the process
이전 댓글 표시
my dataset is aroud 32000rows and 6 columns
my program link
it takes 24 hrs to run,please help how to speed up the process
답변 (1개)
Jan
2011년 12월 29일
0 개 추천
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
Pat
2011년 12월 29일
Walter Roberson
2011년 12월 29일
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
2011년 12월 29일
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
2011년 12월 30일
카테고리
도움말 센터 및 File Exchange에서 Debugging and Improving Code에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!