Jprofiler or another: how do I roll up calls to recursive methods?

I have a long operation that I want to profile in JProfiler (or other sentences), but the method is very recursive, so the tree view in the CPU view does not help much. He shows me the processor like this:

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

You see that recursiveMethod really takes no time. Rather, its otherMethods , which takes time, and the ones I want to profile. My ideal view would show that recursiveMethod has about 0% of the time and otherMethods about 100%.

So, is there a way in JProfiler to flip this view so that I can see where my CPU time is being spent more clearly? Anyone have a suggestion for another profiler who can do this?

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

Thanks!

+6
source share
1 answer

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

You can sort by inheritance time (maybe what you are looking for), average time and calls, and then follow the call stack from where these expensive calls were made. “Hot Spot Type” also appears at the top of the window, so you can see the time spent on JDBC requests, the URL and many other parameters are called.

+1
source

Source: https://habr.com/ru/post/894391/


All Articles