This is an archive of the discontinued LLVM Phabricator instance.

Refactor Timer class
ClosedPublic

Authored by labath on Nov 2 2016, 7:14 AM.

Details

Summary

While removing TimeValue from this class I noticed a lot of room for small
simplifications here. Main are:

  • instead of complicated start-stop dances to compute own time, each Timer just starts the timer once, and keeps track of the durations of child timers. Then the own time can be computed at the end by subtracting the two values.
  • remove double accounting in TimerStack - the stack object already knows the number of timers.

The interface does not lend itself well to unit testing, but I have added a
couple of tests which can (and did) catch any obvious errors.

Diff Detail

Repository
rL LLVM

Event Timeline

labath updated this revision to Diff 76699.Nov 2 2016, 7:14 AM
labath retitled this revision from to Refactor Timer class.
labath updated this object.
labath added reviewers: tberghammer, clayborg.
labath added a subscriber: lldb-commits.
labath updated this revision to Diff 76701.Nov 2 2016, 7:17 AM

run clang-format

clayborg accepted this revision.Nov 2 2016, 8:51 AM
clayborg edited edge metadata.
This revision is now accepted and ready to land.Nov 2 2016, 8:51 AM
This revision was automatically updated to reflect the committed changes.