Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an IntelliJ Java Profiler [closed]

Is there a Profiler for IntelliJ like the one for Matlab?

Let's say you have this code

a = true; i = 0; while(a) {    if(a)       i++    // some fancy stuff which takes 1 second each loop    if(i > 1e6) break; }   

Now I run the code

In Matlab it would look like this after I opened the Profiler

calls  time      1  0.0      a = true;      1  0.0      i = 0;      1  0.0      while(a)                  {    1e3  1.0        if(a)    1e3  0.4         i++    1e3  1e3         // some fancy stuff which takes 1 second each loop    1e3  1.2         if(i > 1e3) break;                  }   
like image 718
GavriYashar Avatar asked Jan 15 '14 20:01

GavriYashar


People also ask

Does IntelliJ have a profiler?

How IntelliJ IDEA profiler works For CPU and allocation profiling, IntelliJ IDEA provides integration with the following profilers: Java Flight Recorder – a standard profiling tool shipped as part of the JDK. Async Profiler – a very accurate profiler that can also collect native call and memory allocation data.

How do I use IntelliJ profiler?

It is easy to start profiling your application – just open the Profiler tool window from the bottom toolbar, select a running process, and right-click it to choose which profiler to attach. You can then stop profiling and see the results in the same tool window.


2 Answers

All profilers that are available for Java, which can be used in IntelliJ will show invocation times only aggregated on method level. You can use for example VisualVM, JProfiler or YourKit, but only summary time will be shown.

like image 174
Jakub Kubrynski Avatar answered Oct 14 '22 07:10

Jakub Kubrynski


JProfiler has a plugin for IntelliJ IDEA.

It adds "Profile" actions to IntelliJ IDEA, similar to the "Run" and "Debug" actions. The profiler UI is not embedded in IDEA but started as a separate process. However, you can use your existing run configurations for profiling and source code navigations goes back to IDEA.

You have to install JProfiler as a standalone product, the plugin will ask you about the installation directory of JProfiler when you profile something for the first time.

Disclaimer: My company develops JProfiler.

like image 29
Ingo Kegel Avatar answered Oct 14 '22 06:10

Ingo Kegel