Hit Count

I would like to understand better what the Hit Count Column on the code window of the profiling results represents.

Is the hit count of the method in the time frame selected or is the the hit count during the entire profiling session?

For example I have a method in the call graph that shows it was called 1 time, but in the code view the hit count states 18.


  • The hit count in the code window shows the hit count during the time frame selected on the time line. It is the total over all method calls.

    In the call graph, it also shows hitcounts for the time selected in the timeline. But it's a bit more complex, since the hit count of a method in the callgraph is the total over all calls from the method the callgraph was created for.

    For instance, suppose the following calls occurred in your program:

    MethodA calls MethodC 1 time
    MethodB calls MethodC 17 times

    The source view would show MethodC having 18 hits.

    But if you created a callgraph for MethodA, MethodC will be shown as having only 1 hit in the callgraph. This is because over all stackframes from MethodA, MethodC only occurs once.

    Similarly, creating a callgraph for MethodB will show MethodC having 17 hits in the callgraph. Creating a callgraph for MethodC will show MethodC having 18 hits.

    I hope this helps!
    Jason Crease
    Red Gate Software
Sign In or Register to comment.