cpu-profile-analysis

Analyze V8 CPU profiles and Chrome DevTools trace files to find performance bottlenecks.

1|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/voidful/Aixlarity --skill cpu-profile-analysis-voidful
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpu-profile-analysis
Source: https://github.com/voidful/Aixlarity/tree/main/aixlarity-ide/.github/skills/cpu-profile-analysis
Command: npx skills add https://github.com/voidful/Aixlarity --skill cpu-profile-analysis-voidful

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Performance profiles from V8 and Chrome DevTools are massive, dense JSON files that are nearly impossible to interpret by hand. This Skill turns raw .cpuprofile and Trace-*.json data into concrete answers: which functions consume the most CPU time, where long tasks block the main thread, and why one code path is slower than another. ## Core Features & Use Cases - CPU Profile Analysis: Parse .cpuprofile files to compute self-time and total-time per function, identify activity regions, and measure timing between milestones. - DevTools Trace Analysis: Process Trace-*.json files to inspect user timing marks, long tasks, layout/paint events, GC pressure, input latency, and multi-process activity across Renderer, Browser, and GPU processes. - Huge File Handling: Buffer-based parsing strategies for profiles exceeding V8's ~512MB string limit, so even gigabyte-scale traces can be analyzed. - Use Case: A user captures a DevTools trace of a slow VS Code window load and asks why startup takes 4 seconds. The Skill extracts user timing marks like code/didResolveTextFileEditorModel, lists long tasks over 50ms, and ranks functions by duration with source locations. ## Quick Start Analyze the attached Trace-2024.json file and tell me which functions consumed the most CPU time on the renderer main thread.

Frequently Asked Questions about cpu-profile-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze a .cpuprofile file to find slow functions?

Parse the JSON to build a node map from the nodes array, then walk each sample's stack from leaf to root. Compute self-time per function using the timeDeltas array, sort descending, and the top entries reveal where CPU time was actually spent.

What is the difference between a .cpuprofile and a DevTools Trace-*.json file?

A .cpuprofile contains only V8 sampling profiler data: nodes, samples, and timeDeltas. A Trace-*.json file uses the Chrome Trace Event Format and additionally includes layout/paint events, user timing marks, GC events, input events, and multi-process data.

Why does JSON.parse fail on large trace files?

V8 cannot create strings larger than roughly 512MB, so readFileSync with utf8 encoding fails on huge traces. Read the file as a raw Buffer instead, scan for JSON key boundaries by bytes, and parse small sub-buffers individually.

How do I find long tasks blocking the main thread in a Chrome trace?

Filter traceEvents for entries named RunTask with phase X and dur greater than 50000 microseconds on the CrRendererMain thread. Sorting these by duration descending surfaces the tasks that block responsiveness.

Can I extract CPU profile data from a DevTools trace file?

Yes. Trace files embed the full CPU profile as Profile and ProfileChunk events in the disabled-by-default-v8.cpu_profiler category. Merge the nodes, samples, and timeDeltas from all chunks to reconstruct a complete cpuprofile-equivalent structure.

What are the limitations of sampling profiler data?

A sampling profiler only captures call stacks at periodic ticks, so short-lived functions may never appear. Do not expect exact function names or complete coverage; instead look for patterns, marker function sets, and broader activity regions.