Skip to content

add cpu-profile analysis skill#308963

Merged
jrieken merged 1 commit intomainfrom
joh/continuous-loon
Apr 10, 2026
Merged

add cpu-profile analysis skill#308963
jrieken merged 1 commit intomainfrom
joh/continuous-loon

Conversation

@jrieken
Copy link
Copy Markdown
Member

@jrieken jrieken commented Apr 10, 2026

No description provided.

@jrieken jrieken enabled auto-merge (squash) April 10, 2026 07:34
@jrieken jrieken self-assigned this Apr 10, 2026
Copilot AI review requested due to automatic review settings April 10, 2026 07:34
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: e9aba237 Current: 8dac53b7

Changed (1)

agentSessionsViewer/ApprovalRowLongLabel/Dark
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new GitHub “skill” document to guide analysis of V8 .cpuprofile and Chrome/Electron DevTools trace (Trace-*.json) artifacts, outlining workflows for identifying bottlenecks, timing milestones, and handling very large profile/trace files.

Changes:

  • Introduces a new cpu-profile-analysis skill with guidance for interpreting .cpuprofile structures and trace event timelines.
  • Provides suggested Node.js-based parsing/analysis procedures, including strategies for huge files via Buffer scanning.
Show a summary per file
File Description
.github/skills/cpu-profile-analysis/SKILL.md New skill documentation describing CPU profile + trace analysis workflows and large-file parsing strategies

Copilot's findings

Comments suppressed due to low confidence (2)

.github/skills/cpu-profile-analysis/SKILL.md:257

  • This snippet uses fs.writeFileSync(...) but the example only imports { readFileSync, statSync } above. Either import writeFileSync (or fs) in the code block, or rewrite the snippet to avoid referring to an undeclared fs identifier.
```javascript
import { readFileSync, statSync } from 'fs';

const stat = statSync(tracePath);
const sizeMB = stat.size / (1024 * 1024);
console.log(`File size: ${sizeMB.toFixed(0)}MB`);

let data;
if (sizeMB < 400) {
    data = JSON.parse(readFileSync(tracePath, 'utf8'));
} else {
    // Too large -- use Buffer-based extraction (see "Handling Huge Files" section)
    data = parseTraceFromBuffer(readFileSync(tracePath));
}
const events = data.traceEvents;

2. Reformat the File (small files only)

For small trace files, reformat for inspection:

if (sizeMB < 400) {
    fs.writeFileSync(tracePath, JSON.stringify(data, null, 2));
}
**.github/skills/cpu-profile-analysis/SKILL.md:263**
* The "Build Data Structures" snippet calls `fs.readFileSync(...)` but `fs` is not imported/defined in the example. Prefer `readFileSync(...)` (already used earlier) or add an explicit `import * as fs from 'fs';` to keep the example executable.
const data = JSON.parse(fs.readFileSync(tracePath, 'utf8'));
const events = data.traceEvents;
  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread .github/skills/cpu-profile-analysis/SKILL.md
Comment thread .github/skills/cpu-profile-analysis/SKILL.md
@jrieken jrieken merged commit f836075 into main Apr 10, 2026
30 checks passed
@jrieken jrieken deleted the joh/continuous-loon branch April 10, 2026 07:56
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants