Question

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;
                 }  
Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top