Updated on 2025-06-27 GMT+08:00

Comparison

Profiler compares the method, class, and thread calling relationships and execution efficiency of two instances or the same instance in different time ranges through flame graphs, helping you understand code performance differences.

Procedure

  1. Log in to the management console.
  2. Click on the left and choose Application > Application Performance Management.
  3. In the navigation pane, choose Application Monitoring > Metrics.
  4. In the tree on the left, click next to the target environment.
  5. Click the Profiler Performance Analysis tab.
  6. Click Compare.
  7. On the displayed page, select an instance, performance analysis type, code, aggregation dimension, and comparison type.

    Figure 1 Comparison
    • Comparison object: and can be different instances or the same instance in different time ranges.
    • Instance: Only one instance can be selected.
    • Select a time range. Default: Last 20 minutes.

      Options: Last 5 minutes, Last 20 minutes, Last hour, Last 3 hours, Last 6 hours, Last day, Today, Yesterday, or Custom.

      Figure 2 Instance comparison
    • Type: Select a type from the drop-down list. Options: CPU Time, Allocated Memory, Latency, and Live Object Memory.
    • Code: Select a range from the drop-down list. Options: My Code and All Code.
    • Group By: Select an aggregation dimension from the drop-down list. Options: Line, Method, Class, and Package.
      Table 1 Type description

      Item

      Parameter

      Description

      Type

      CPU Time

      CPU time for each method.

      Allocated Memory

      Allocated heap memory (including both reclaimed and unreclaimed memory). It can be used in the frequent GC scenario.

      Latency

      Total time consumed for executing the methods of trace-related threads. It includes the CPU time and I/O wait time.

      Live Object Memory

      Heap memory that has been allocated but has not been reclaimed. It is used in the memory leakage scenario. This feature requires the JDK version to be 17.

      Code

      My Code

      User code.

      All Code

      All code.

      Group By

      Line

      Code line.

      Method

      Method.

      Class

      Class.

      Package

      Java package name.

    • Comparison Type: Select a type from the drop-down list. Options: Table and Flame.
    • Search by method path: Set search criteria in the search box and click to view the flame graph that meets the search criteria.
    • The calling relationships and execution efficiency of each method, class, and thread are displayed in real time in the lower part of the page.
      Table 2 Comparison parameters

      Parameter

      Description

      flame

      • The Y axis (vertical axis) of the flame graph indicates the call stack. Each layer is a function (package). The deeper a call, the higher a flame. The bottom (flame end) is the function that is being executed, and the top is the parent function.
      • The X axis (horizontal axis) of the flame graph indicates the CPU time, total time for executing trace-related thread methods, allocated heap memory, or heap memory that has been allocated but has not been reclaimed. Take the CPU time as an example. The longer the CPU time, the longer the distance on the X axis of the flame graph.
      • In the flame graph, red indicates that the current instance has a larger value, green indicates that the current instance has a smaller value, blue indicates that the method, class, or thread exists only on the current instance, and white indicates that the two instances have the same value.
      • Move the cursor to the flame graph to check the details about a method, class, or thread.
      • Click a method bar in the flame graph. It is zoomed in horizontally. To restore the flame graph, click the Total column.

      table

      • Displays Method Path, Baseline, Comparison, and Diff.
      • Move the cursor to a target method to check comparison details.