Advanced CPU Profiling in Node - Profile Data Structure
Table of Contents

CPU profiles in Chrome DevTools can reveal a lot about how your application runs, but making sense of the underlying data structures isn’t always straightforward. Even experienced developers often find the structure of these JSON files less than intuitive. In this article, we break down the main components that make up CPU profile data and examine how they’re represented in DevTools. With a clearer grasp of these building blocks, you will be better equipped to investigate performance and spot optimization opportunities.
Data Structure
CPU profiles are JSON files that contain structured data representing the execution timeline and call hierarchy of your Node.js application. The profile consists of nodes representing function calls, timing information, and sampling data that can be visualized in DevTools.
The example below shows a minimal CPU profile.
Profile: minimal-cpu-profile.cpuprofile
Profile content:
DevTools Performance Tab:

Dimensions and Timing Data
CPU profiles represent execution data across two primary dimensions: time (horizontal axis) and call-tree depth (vertical axis). Understanding these dimensions is crucial for interpreting flame charts and performance data.
Dimensions
- the microsecond timestamp when profiling beganstartTime
- equalsendTime
, marking the profile's visible endstartTime + Σ timeDeltas
Timing Data
- an array of intervals (μs) between each sample tick. Time deltas overflow the visible end of the measure.timeDeltas
- an array of node IDs indicating which nodes were active during the profile.samples
Time (horizontal axis) represents the execution timeline with startTime
endTime
timeDeltas
Call-tree depth (vertical axis) shows the function call hierarchy where the root node is at depth 0, and each level represents nested function calls. The samples
The example below shows a profile with one node (ID 2) centered in the middle of the chart. Its position in the timeline is determined by the timeDeltas
endTime
Profile: minimal-cpu-profile-timing-data.cpuprofile
DevTools Performance Tab:

Time deltas
Profile: minimal-cpu-profile-timing-data-time-deltas.cpuprofile
DevTools Performance Tab:

Samples
Samples are the list of "visible" nodes when viewed from the bottom of the chart. Listing a node at a given timeDelta
samples
samples
Profile: minimal-cpu-profile-timing-data-samples.cpuprofile
This example draws the same node sequence (1->2->3) twice.
The first time, it draws them as a tower, where each frame has the same width (takes the same time).
"samples": [1, 3, 3, 1], "timeDeltas": [0, 100, 100, 100]
(visualized as ▀▀)
The second time, it draws them as a flame, where each frame is slightly narrower and nested inside its parent.
"samples": [1, 2, 3, 2, 1], "timeDeltas": [0, 100, 100, 100, 100]
(visualized as ▔▀▔)
DevTools Performance Tab:

Nodes
Parent and child nodes
Node relationships define the call hierarchy through parent-child references that mirror the JavaScript call stack. These relationships enable reconstruction of the complete call tree for flame chart visualization and performance analysis.
parent
children
Traversal starts at the root (no parent
children
Profile: minimal-cpu-profile-nodes-parent-child.cpuprofile
DevTools Performance Tab:

This view shows only part of the node tree. In the samples
parent
children
CallFrame
A callFrame
Source Location and label
The callFrame
: The name of the executed function.functionName
: The file path or URL of the script. This also determines the color-coding of frames in the flame chart (same URL means same color).url
: A unique identifier for the script.scriptId
: The line number within the script.lineNumber
: The column number within the script.columnNumber
Profile: minimal-cpu-profile-nodes-call-frame-source-location.cpuprofile
DevTools Performance Tab:

URL and coloring
The url
callFrame
Profile: minimal-cpu-profile-nodes-call-frame-url.cpuprofile
DevTools Performance Tab:

Synthetic and Internal Frames
Synthetic frames are not actual lines from your code but markers added by the V8 engine (the JavaScript engine in Chrome and Node.js). These frames provide important context about the execution environment and system-level operations.
A synthetic frame has functionName
scriptId
"0"
url
""
lineNumber
columnNumber
-1
What they represent:
Frame Name | What It Means |
---|---|
| The very start of the profile session (entry point) |
| Your top-level script (code not inside any function) |
| Time when nothing is happening — app is waiting |
| Time spent cleaning memory — V8 is reclaiming RAM |
Profile: minimal-cpu-profile-nodes-call-frame-synthetic-frames.cpuprofile
DevTools Performance Tab:

Conclusion
Demystifying the core data structures behind CPU profiles is an important step toward effective performance analysis in Chrome DevTools. With this knowledge, you will find it easier to read and use actual profiling output in your daily work. The next article will show these concepts in action with real-world profiling examples and hands-on analysis.
If you need expert help with profiling or a full performance audit, our team is here to assist.