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; }
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With