Read the pprof profile
After you collect a profile, you can analyze it in the Go Performance Optimization tool window.
The profiler shows sampled data about your program execution. Each sample represents a captured call stack, so all values are estimates based on statistical sampling.
You can view the data using different representations, such as a table, a call graph, or a flame graph. Each view highlights a different aspect of performance and helps you find expensive functions and call paths.
Switch a sample type
Use the Show menu in the top-right corner of the tool window.

The Go profiler provides several views to analyze the snapshot:
Top: a flat view that shows aggregated statistics for functions.
Graph: a call graph that shows relationships between functions.
Flame Graph: a visual representation of call stacks that helps you identify hot paths.
Tree: a hierarchical view of function calls and their contribution to execution time.
Top
The Top view shows aggregated profiling data for functions in a flat table. Each row represents a function and shows how much time or how many samples were recorded for it.

The data in this view comes from profiling samples. Each sample represents a captured call stack during program execution.
The table includes the following metrics:
Flat – the time or number of samples recorded in the function itself. It does not include time or samples from functions that it calls.
Flat% – the percentage of total time or samples recorded in the function itself.
Sum% – the running total of Flat% values from top to bottom.
Cumulative – the total time or number of samples recorded in the function and all functions that it calls.
Cumulative% – the percentage of total time or samples that includes the function and its callees.
Use this view to find the most expensive functions. Start with functions that have the highest Flat or Cumulative values.
The values are based on statistical sampling. Each sample represents a captured call stack, so the numbers are estimates.
Navigate to source code
Click a function in the table to open its source code.
Sort results
Click a column header to sort functions by the selected metric, for example Flat or Cumulative.
Search in the top
Type a function name to highlight matching blocks.
Graph
The Graph view shows the call graph of your application. It displays functions as nodes and calls between them as edges.

Each node represents a function. Each edge represents a call from one function to another. The size and color of nodes reflect how much data is associated with each function, based on the selected sample type.
Each node label shows two values:
the value recorded in the function itself
the total value recorded in the function and all functions it calls
Use this view to understand how functions call each other and to identify expensive call paths.
Configure the graph display
Configure the graph options:
Node count limits the number of displayed functions.
Node fraction hides functions that contribute less than the specified share of total samples.
Call tree controls how functions are displayed on the graph. When this option is disabled, nodes with the same function are merged into a single node. When it is enabled, each call is shown separately, which helps you distinguish between different call paths.
For example, if the function
foo()is called from different places in your program, the default graph shows a single node forfoo(), but with Call tree enabled, each call tofoo()appears as a separate node.
Click Apply to update the graph.
Navigate the graph
Click a node to focus on a function and inspect its connections.
Double-click a node to open the function in the editor.
Drag the graph to move the view. You can use the right mouse button, or hold Ctrl and drag with the left or right mouse button.
Flame Graph
The flame graph shows the call stack as a set of rectangles. Each rectangle represents a function call. The width of a rectangle shows how much time or how many samples the function uses. Wider rectangles indicate heavier functions.
Parent functions appear below their children. This layout helps you understand how work flows through your code.

Zoom the graph
Use the Zoom In (
) and Zoom Out (
) icons to zoom in or out.
Double-click a block to focus on a specific function.
Click the Reset Zoom (
) icon to reset the zoom level.
Configure view settings
Open the view settings menu in the toolbar.
Enable or disable the following options:
Show Icicle Graph: switches between flame and icicle layout.
Sticky Text: keeps function names visible when zooming.
New Flame Graph View: uses the updated rendering mode.
Navigate with Single Click: opens functions with one click.

Search in the graph
Click the Show Search Toolbar (
) or press Ctrl+F.
Type a function name to highlight matching blocks.
Use navigation controls to move between matches.

Get function details
Hover over a block to see details.

Capture the graph
Click the Capture Image icon (
) in the toolbar.
Select one of the options:
Copy to Clipboard: copies the graph as an image.
Save: saves the graph as a PNG file.
Tree
The tree view shows function calls as a hierarchy. Each row represents a function. Child rows show functions that were called by the parent.
This view helps you understand how execution flows through the application and which call paths consume resources.

Configure view settings
Open the view settings menu in the toolbar.
Enable or disable the following options:
Show Percentage of Total Time: shows the share relative to the whole profile.
Show Percentage of Parent: shows the share relative to the parent function.
Navigate with Single Click: opens code on a single click.

Navigate the tree
Expand or collapse nodes to explore call paths.
Select a function to view its metrics.
Interpret metrics
Use the columns to analyze resource usage:
Flat – memory used or allocated directly in the function.
Flat% – share of total usage in the function.
Cumulative – memory used in the function and all its callees.
Cumulative% – share of total usage including child calls.
Search in the tree
Type a function name to highlight matching blocks.
Line profiler
When you open a snapshot, GoLand shows the Profiler tool window and adds runtime hints near the corresponding lines right in the editor.
Lines that took a significant amount of time to execute get grey labels, while the most resource consuming ones are marked with red labels with the fire icon.

Switching the viewing mode in the Profiler tool window also changes the mode for the labels in the editor. You can choose to view the total execution time of the method, its CPU time, or the amount of memory allocated as the result of executing this line.
If you want to drill-down and see what's inside a labeled method, clicking the hint will take you to the method declaration, where you can inspect the particular lines causing slowness.
