most time-consuming lines are self-time
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I did the profile of the code, and it seems the most time-consuming lines are self-time (as attached). At this case, may I know what is a right way to reduce the running time?
Thank you.
1 Kommentar
Adam Danz
am 2 Jul. 2018
Bearbeitet: Adam Danz
am 2 Jul. 2018
You have almost 2 million calls to the first line of code listed and at least a million calls to the 2nd and 3rd lines. You must be doing something in a loop which could be evaluated for simplicity. A very fast function that consumes 50ms run 1 million times would accrue to nearly 14 hours. Looking at this screenshot doesn't provide much information as to how your code is structured.
As for reducing overhead time, see this comment which discusses the tradeoff of reducing overhead and potentially reducing readability.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Scope Variables and Generate Names finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!