IntelliJ IDEA
 
Get IntelliJ IDEA

Compare profiler snapshots

Last modified: 29 October 2024

IntelliJ IDEA allows you to compare profiler snapshots. This may be useful to see how a certain change in the code affects performance or how the same piece of code performs in different runtimes.

For comparison, you can use the flame graph, the call tree, or the method list. In the comparison mode, the tabs offer their regular functionality while additionally showing how the two snapshots differ in terms of each entry (for example, a tree node or a method list item).

Method List tab in the comparison mode

Let's look at the flame graph.

Flame graph in the comparison mode

Where a part of a frame is green, it means that this frame had less execution time in the second snapshot. If its entire frame is green, it means that the frame is completely absent from the second snapshot. A red color means that the frame had more samples in the second snapshot and more execution time, accordingly.

For example, the following section of the graph tells us that the findDuplicates() method became more than twice as fast, and that this was because of reduced time spent in forEach and filter. This doesn't necessarily mean, however, that the implementation has improved. This might also be attributed to the possibility that the method had a different amount of data to process in the second run.

Hovering over a frame in the flame graph provides comparison details