GitXplorerGitXplorer
e

hprof

public
80 stars
11 forks
5 issues

Commits

List of commits on branch master.
Unverified
e79c50a5d7aabd869253b3aec33edef564328e37

Bump version to 0.1.3

eemberian committed 9 years ago
Unverified
b7446cf7b4a0968e98d1fcf4e8a5b4cb308be54d

Merge pull request #6 from adambadawy/master

eemberian committed 9 years ago
Unverified
ead90fccc413c6d28900db93589c6fd124372451

Fix always removing current ProfileNode

committed 9 years ago
Unverified
6eaf143d5a2218c4f694bfc63c310803808ab4c5

Auto merge of #5 - haptics-nri:hertz, r=cmr

hhomu committed 9 years ago
Unverified
a58ab7ebe1e3005758ad15868bca1c5899b6e3ff

show Hz at top level, avg iter time for children

committed 9 years ago
Unverified
780b067d7a1a9c7b2f5b504a0ca8ebff33960e7e

Merge pull request #3 from csherratt/master

eemberian committed 9 years ago

README

The README file for this repository.

hprof, a real-time hierarchical profiler

Travis Crates.io

Documentation

hprof is suitable only for getting rough measurements of "systems", rather than fine-tuned profiling data. Consider using perf, SystemTap, DTrace, VTune, etc for more detailed profiling.

What is hierarchical profiling?

Hierarchical profiling is based on the observation that games are typically organized into a "tree" of behavior. You have an AI system that does path planning, making tactical decisions, etc. You have a physics system that does collision detection, rigid body dynamics, etc. A tree might look like:

  • Physics
    • Collision detection
      • Broad phase
      • Narrow phase
    • Fluid simulation
    • Rigid body simulation
      • Collision resolution
      • Update positions
  • AI
    • Path planning
    • Combat tactics
    • Build queue maintenance
  • Render
    • Frustum culling
    • Draw call sorting
    • Draw call submission
    • GPU wait

A hierarchical profiler will annotate this tree with how much time each step took. This is an extension of timer-based profiling, where a timer is used to measure how long a block of code takes to execute. Rather than coding up a one-time timer, you merely call Profiler::enter("description of thing") and a new entry will be made in the profile tree.

The idea came from a 2002 article in Game Programming Gems 3, "Real-Time Hierarchical Profiling" by Greg Hjelstrom and Byon Garrabrant from Westwood Studios. They report having thousands of profile nodes active at a time.

License

This software is licensed under the Boost Software License. In short, you are free to use, modify, and redistribute in any form without attribution.

Example Output

Timing information for main loop:
  setup - 1133523ns (6.725068%)
  physics - 2258292ns (13.3982%)
    collision - 1140731ns (50.512998%)
    update positions - 1108782ns (49.098257%)
  render - 13446767ns (79.778204%)
    cull - 1134725ns (8.438646%)
    gpu submit - 2197346ns (16.341073%)
    gpu wait - 10088879ns (75.028287%)