jprofiler or other: how do I roll up recursive method calls?
Asked Answered
C

1

8

I have a long operation that I want to profile in JProfiler (or other suggestions), but the method is very recursive, so the tree view in CPU View doesn't help very much. It shows me CPU times like this:

beginOperation 100%
|- recursiveMethod 99%
| | - recursiveMethod 98%
| | | - recursiveMethod 97%
| | | | - ...more recursion
| | |- otherMethods 1%
| | - otherMethod 1%
| - otherMethods 1%

You see, the recursiveMethod really doesn't take any time at all. Rather, its the otherMethods that take up time, and are the ones I want to profile. My ideal view would show recursiveMethod having next to 0% time, and the otherMethods combining to near 100%.

So is there any way in JProfiler to roll this view up so that I can view where my CPU time is being spent more clearly? Does anyone have a suggestion for another profiler that can do this?

Note: I am using JProfiler 6, but could potentially upgrade if another version could do this.

Thanks!

Corked answered 5/8, 2011 at 15:19 Comment(0)
C
2

JProfiler has a 'Hot Spots' view useful for gathering these types of performance metrics. To get to this view, go to 'CPU Views' on the left hand navigation and 'Hot Spots' should be the second button the left at the bottom of the application window. (These instructions are based on JProfiler 5, but I believe this is the same on version 6).

You can sort by inhernet time (probably what you're looking for), average time and invocations and then follow the call stack up from where those expensive calls were made. At the top of the view, there's also a drop down to change the 'Hot Spot Type', so you can look at the time consumed by JDBC queries, invoked URL and many other options.

Corium answered 12/8, 2011 at 6:33 Comment(1)
Thank you. The hotspots gave me the roll up I was looking for.Corked

© 2022 - 2024 — McMap. All rights reserved.