jprofiler 或其他:如何汇总递归方法调用?
我有一个很长的操作,我想在 JProfiler (或其他建议)中进行分析,但该方法非常递归,因此 CPU 视图中的树视图没有多大帮助。它向我显示了这样的 CPU 时间:
beginOperation 100%
|- recursiveMethod 99%
| | - recursiveMethod 98%
| | | - recursiveMethod 97%
| | | | - ...more recursion
| | |- otherMethods 1%
| | - otherMethod 1%
| - otherMethods 1%
您看,recursiveMethod
确实根本不需要任何时间。相反,它是占用时间的 otherMethods
,也是我想要分析的。我的理想视图将显示 recursiveMethod
的时间接近 0%,而 otherMethods
组合的时间接近 100%。
那么 JProfiler 中有什么方法可以滚动这个视图,以便我可以更清楚地查看我的 CPU 时间都花在哪里了?有人对另一个可以做到这一点的分析器有建议吗?
注意:我使用的是 JProfiler 6,但如果其他版本可以做到这一点,则可能会升级。
谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JProfiler 有一个“热点”视图,对于收集这些类型的性能指标非常有用。要访问此视图,请转到左侧导航中的“CPU 视图”,“热点”应该是应用程序窗口底部左侧的第二个按钮。 (这些说明基于 JProfiler 5,但我相信这在版本 6 上是相同的)。
您可以按固有时间(可能是您正在寻找的)、平均时间和调用进行排序,然后从进行这些昂贵调用的位置开始跟踪调用堆栈。在视图顶部,还有一个用于更改“热点类型”的下拉菜单,因此您可以查看 JDBC 查询、调用的 URL 和许多其他选项所消耗的时间。
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.