Java逐行方法/函数分析 - Profiler和/或Eclipse插件 [英] Java line-by-line Method/Function Profiling - Profiler &/or Eclipse Plugin

查看:234
本文介绍了Java逐行方法/函数分析 - Profiler和/或Eclipse插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些更大的方法我试图在Java中优化。我一直在使用jVisualVM做大部分的分析,因为它提供了方法调用的热点,是一个很好的起点。



我正在寻找的是一个逐行热点分析器,可以帮助我缩小拍摄时间。过去使用过的非常有趣的工作就是在策略性地放置System.currentTimeMillis()打印,在更极端的情况下使用 Java CPUTime (通过JNI完成)。有几个Profiler,如Intel Parallel Amplifier,可与C& Visual Studio,但是有没有这样的Java?



这两个选项都有点乏味,所以有什么(Eclipse插件或其他),可以逐行热点分析?

解决方案

JProfiler 具有行号解析。默认情况下不启用,但如果您编辑分析设置,则在方法通话记录选项卡上有一个名为记录行号并在呼叫树中显示的复选框:





免责声明:我公司开发JProfiler。


I have a few larger methods I'm trying to optimize in Java. I have been using jVisualVM to do most of my profiling as it gives method call hot spots and is a great starting point.

What I am looking for is a line-by-line hot spot profiler which can help me narrow down whats taking so long. The ovbious work around which I have used in the past is just strategically placed System.currentTimeMillis() prints and in more extreme cases using Java CPUTime (done via JNI). There are a few profilers like Intel Parallel Amplifier which works with C & Visual Studio, but is there anything like this for Java?

Both of those options are a bit tedious, so is there anything (Eclipse plug-in or otherwise) which can do line-by-line hot spot analysis?

解决方案

JProfiler has line number resolution. It's not enabled by default, but if you edit the profiling settings, there's a check box named "Record line numbers and show them in the call tree" on the "Method call recording" tab:

Disclaimer: My company develops JProfiler.

这篇关于Java逐行方法/函数分析 - Profiler和/或Eclipse插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆