emberian / hprof

A real-time hierarchical profiler
Boost Software License 1.0
80 stars 11 forks source link

show Hz at top level, avg iter time for children #5

Closed durka closed 9 years ago

durka commented 9 years ago

I'm timing tight loops and wanted individual timings as well as Hz (which only makes sense for the entire loop, not parts of it). This patch reworks the format string in ProfileNode::print to show the frequency instead of percentage for top-level nodes (detected by checking if it was going to print "inf%") and the average time-per-iteration for all nodes.

Sample output:

Timing information for structure:
  step - 7 * 560.5ms = 3.9s @ 1.8hz
    depth - 7 * 560.5ms = 3.9s (100.0%)
      readFrame - 7 * 7.8ms = 54.6ms (1.4%)
      frame.data() - 7 * 89ns = 628ns (0.0%)
      PNGEncoder - 7 * 25.3ms = 176.9ms (4.5%)
      tx.send - 7 * 2.3ms = 15.9ms (0.4%)
emberian commented 9 years ago

@homu: r+

homu commented 9 years ago

:pushpin: Commit a58ab7e has been approved by cmr

homu commented 9 years ago

:hourglass: Testing commit a58ab7e with merge 6eaf143...

homu commented 9 years ago

:sunny: Test successful - status