Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java line-by-line Method/Function Profiling - Profiler &/or Eclipse Plugin [closed]

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?

like image 278
NightWolf Avatar asked Feb 15 '12 06:02

NightWolf


1 Answers

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:

enter image description here

Disclaimer: My company develops JProfiler.

like image 58
Ingo Kegel Avatar answered Sep 20 '22 18:09

Ingo Kegel