eugeneloza / decoherence

Project moved to https://gitlab.com/EugeneLoza/decoherence
GNU General Public License v3.0
10 stars 7 forks source link

Recoursive/inherited profiler patch #334

Open eugeneloza opened 6 years ago

eugeneloza commented 6 years ago

If EntryName = Parent.EntryName, then do not use profiler for this procedure (only upper level). Thou I'm not yet sure how to make it work flawlessly. Thou it'll make profiling recursive/inherited procedures much more readable. And still will be problem if sequence proc1 <----> proc2 recursively used. Maybe, check all the parent-levels? Sounds nice, but not too efficient. However, that issue may be solved "display-time", that'll be easier and better.

eugeneloza commented 6 years ago
If aFunction = Parent.EntryName then begin
Result := Parent as TProfiler;
Result.IncreaseCount;
...
CurrentLevel.DecreaseCount;
if CurrentLevel.Count = 0 then GoUpALevel;