CPU Profile Analyzer
Find performance bottlenecks in V8 and DevTools performance files.
The skill primarily reads and analyzes local performance files and requests no credentials, network service, or elevated privilege. However, its small-file procedure overwrites the original profile/trace, without confirmation, backup, or rollback, and it does not disclose that performance data may expose sensitive code paths; points are deducted for these gaps.
The file detection, data structures, and analysis workflow are broadly coherent, with a stated approach for very large files. However, there are no skill-specific tests, the parsers rely on exact JSON formatting assumptions, and handling and feedback for missing fields, malformed input, and parse failures are thin; the static ceiling also limits the score.
The skill clearly covers cpuprofile and Chrome trace inputs, CPU, layout, rendering, GC, input latency, and multi-process scenarios, with reasonably clear triggers. It does not sufficiently define non-fit cases, input variants, output contracts, or Chinese-language and local-network adaptation, so points are deducted.
The documentation is readable and layered, with sections for formats, procedures, examples, limitations, and large-file handling. It lacks skill-specific versioning, changelog, maintenance ownership, update path, installation notes, and troubleshooting; repository-level MIT and Microsoft metadata do not fully replace those disclosures.
The skill provides a practically useful workflow, code fragments, metrics, and a report structure that can guide a Node.js analysis. However, it offers no ready-to-run command, verified sample output, or direct result artifact; users must integrate and potentially correct the snippets, limiting completeness and demonstrated marginal benefit.
The SKILL.md is auditable primary material, and the repository has general CI and test infrastructure. The supplied CI and tests do not directly cover this skill's key paths, and there are no skill-specific tests, real execution results, or independent corroboration, so static verifiability remains limited.
- The small-file reformatting example writes directly to the input file; users should make a copy and confirm before using it.
- The large-file parsers depend on strict JSON key formatting and may fail on whitespace, escaped strings, or format variants.
- There is no skill-specific test suite, executable entry point, or sample result; treat outputs as approximate and manually validate timelines, samples, and trace correlations.
- Profiles and traces may contain file paths, function names, user activity, or business data; redact them before sharing.
What it does & when to use it
This skill analyzes V8 sampling-profiler .cpuprofile files and Chrome/Electron DevTools Trace-*.json files. It reconstructs timelines and call stacks, calculates self time and total time, and compares code paths. For DevTools traces, it also examines long tasks, layout and paint work, user timing marks, garbage collection, input latency, and Browser, Renderer, and GPU processes. It is an individual skill in the microsoft/vscode repository, which is licensed under MIT.
Reads and parses .cpuprofile and Trace-*.json files; selects JSON.parse or Buffer-based extraction based on file size; builds node and parent maps, reconstructs timestamps from timeDeltas, and walks sampled call stacks for CPU profiles; identifies the Renderer CrRendererMain thread, user timing marks, tasks longer than 50 milliseconds, slow FunctionCall events, layout and paint events, GC events, and input events in traces; can reconstruct embedded CPU profiles from ProfileChunk events; and produces timelines, durations, function-cost summaries, key stacks, and process breakdowns through Node.js analysis scripts.
- A VS Code developer has a .cpuprofile and needs to identify the functions consuming the most CPU time.
- An engineer compares old and new implementations represented in one profile and wants to locate differences between their cost centers.
- A performance investigator examines a Trace-*.json file for long tasks, layout thrashing, paint cost, or rendering bottlenecks.
- A developer needs to measure milestones such as code/willResolveTextFileEditorModel and code/didResolveTextFileEditorModel from user timing marks.
- A team needs to understand what the Renderer, Browser, and GPU processes did during a performance recording.
Pros & cons
- Covers both V8 CPU profiles and Chrome/Electron DevTools traces.
- Goes beyond call stacks and function timing to cover long tasks, user timing, layout and paint, GC, input latency, and multi-process behavior.
- Explicitly distinguishes self time, total time, wall-clock duration, and thread duration, helping separate CPU work from waiting or suspension.
- Provides a Buffer-based strategy for very large files and recommends filtering to relevant processes and threads to reduce noise.
- The SKILL.md provides procedures and example scripts rather than a standalone analyzer or test suite.
- It requires local file access, file writing, and a Node.js runtime; the agent must also be able to execute analysis scripts.
- Sampling does not capture every function, and bundled or minified code may have missing or mangled names, so findings are approximate and pattern-based.
- The source does not document validation on applications or platforms outside the VS Code-related scenarios described.
How to install
The repository contains 61 skills; this skill is located at .github/skills/cpu-profile-analysis/SKILL.md. The supplied README does not document an independent installation command or a procedure for copying the file into another client, so use the directory through the loading mechanism of the Agent Skills-compatible client in use. The repository source is licensed under MIT.
How to use
Provide a .cpuprofile or Trace-*.json file to an agent that supports the skill and ask a concrete question, for example: “Analyze this Trace-*.json and identify Renderer main-thread tasks over 50ms, the longest function calls, and expensive layout events.” For files larger than approximately 400MB, use Buffer-based parsing and run the analysis script with node --max-old-space-size=16384; the SKILL.md supplies the relevant scripts and procedures.