Is there an IntelliJ Java Profiler [closed]
Asked Answered
S

2

28

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;
                 }  
Susumu answered 15/1, 2014 at 20:34 Comment(2)
The NetBeans profiler could do that.Yarrow
https://mcmap.net/q/241605/-how-do-you-profile-java-source-with-intellij-idea-editor-closed/32453 may be relatedCatadromous
B
19

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.

Brent answered 15/1, 2014 at 20:53 Comment(7)
The NetBeans profiler (which is essentially what VisualVM is) can take times between any two lines in the code.Yarrow
But it's not available in IntelliJ IDEA :)Brent
I contradicted the part "all profilers that are available for Java".Yarrow
@a_horse_with_no_name you're right - it was a brachylogyBrent
@a_horse_with_no_name: thank you for pointing that out! I'll try it with NetBeansSusumu
Finally there is IntelliJ profiller: blog.jetbrains.com/idea/2018/09/… Pozdrawiam Kuba - dobre prezentacje.Absorb
@yami Thanks :)Brent
P
18

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.

Payment answered 16/1, 2014 at 8:36 Comment(4)
quite expensive just for debuggingSusumu
@Susumu but IntelliJ is already expensive, and JRebel is expensive too. If you don't want expensive then there's always NetBeans which has a FREE profiler ;)Casi
@dexter meyers JProfiler: License with 1 year of Support & Upgrades €599 upgrade: For Single Licenses €159 IDEA: €179 upgrade €89. for my purposes/uses JProfiler is too expensive. IDEA for me was not expensive if you don't want to use NetBeans or Eclipse. but i can stick with the fact that there is no such feature.Susumu
Finally there is IntelliJ profiller: blog.jetbrains.com/idea/2018/09/…Absorb

© 2022 - 2024 — McMap. All rights reserved.