Measure performance of 2 programmes

1 回表示 (過去 30 日間)
Xiaohan Du
Xiaohan Du 2018 年 8 月 10 日
回答済み: Stephan 2018 年 8 月 10 日
Hello,
I have 2 codes codeOld and codeNew, each contains many methods (i.e. both very complex). I'd like to prove that codeNew is better than codeOld as the former is faster. So I googled it and found the following functions to measure the performance: timeit, tic toc, cputime.
I used tic toc before but people say I should use timeit. But I read in many papers, they measure the performance of a code using cputime. This is confusing me because in this help page: https://uk.mathworks.com/help/matlab/matlab_prog/measure-performance-of-your-program.html They say cputime can be misleading.
So which one should I use if I want to measure the performance and speed of my code?
Many thanks!

回答 (1 件)

Stephan
Stephan 2018 年 8 月 10 日
Hi,
i suggest to use this:
This is good for comparison and also for finding bottlenecks and possobilities for improvement.
Best regards
Stephan

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by