フィルターのクリア

Thoughts on improving function execution time?

1 回表示 (過去 30 日間)
CD
CD 2021 年 3 月 24 日
回答済み: Vidip 2024 年 5 月 7 日
Matlab Community/Experts,
I was able to reduce the execution time of the attached function from about 120 hours down to about 2 1/2 hours with the use of "parfor" and vectorization.
Would be great to reduce execution time further without installing the parallelization tool box.
Does anyone have any thoughts/suggestion on how to further reduce exection time?
Spent a good part of the day digging through various similar answered quesitons though I am tapped out.
Also attached a snap-shot of my CPU performance at high and low utilization periods. I think that my laptop has the "capacity" to do more work though I do not know how to tweak it (without dipping into the parallel tool box).
Thank you,
CD

回答 (1 件)

Vidip
Vidip 2024 年 5 月 7 日
I understand that you have already used ‘parfor’, vectorization and want to further optimize and potentially reduce execution time. You can use external libraries or MEX files, for computationally intensive tasks that cannot be optimized further in MATLAB, consider writing critical parts of your code in C or C++ and compiling them into MEX files. This approach can significantly speed up execution. Also, use MATLAB's Profiler again after making changes to ensure that your optimizations are having the intended effect. Sometimes, optimizations can have unexpected impacts on performance.
For more information, you can refer to the documentation links below –

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by