microsoft/vscode/chat-perf
- vendor
Checking that the SKILL.md file is still in the repository.
Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.
Install
npx vskill@latest install microsoft/vscode/chat-perfSKILL.md
Chat Performance Testing
When to use
- Before/after modifying chat rendering code (
chatListRenderer.ts,chatInputPart.ts, markdown rendering) - When changing the streaming response pipeline or SSE processing
- When modifying disposable/lifecycle patterns in chat components
- To compare performance between two VS Code releases
- In CI to gate PRs that touch chat UI code
Quick start
Perf regression test
Script: scripts/chat-simulation/test-chat-perf-regression.js npm: npm run perf:chat
Launches VS Code via Playwright Electron, opens the chat panel, sends a message with a mock LLM response, and measures timing, layout, and rendering metrics. By default, downloads VS Code 1.115.0 as a baseline, benchmarks it, then benchmarks the local dev build and compares.
You don't always need a baseline. A baseline exists only for comparison (regression detection). If you just want the current build's numbers — profiling a single change, capturing traces/heap snapshots, or iterating on a scenario — pass--no-baselineto skip downloading and benchmarking the baseline entirely (roughly halves runtime). Baseline comparison is what turns raw measurements into a pass/fail verdict; without it you still get all the metrics, just no verdict.
Key flags
| Flag | Default | Description | ||
|---|---|---|---|---|
--runs <n> | 5 | Runs per scenario. More = more stable. Use 5+ for CI. | ||
--scenario <id> / -s | all | Scenario to test (repeatable). See common/perf-scenarios.js. | ||
| `--build <path\ | ver> / -b` | local dev | Build to test. Accepts path or version (1.110.0, insiders, commit hash). | |
--baseline <path> | — | Compare against a previously saved baseline JSON file. | ||
| `--baseline-build <path\ | ver>` | 1.115.0 | Version or local path to benchmark as baseline. | |
--no-baseline | — | Skip the baseline entirely — just measure the test build (no download, no comparison, ~2× faster). Use when you only need raw numbers, not a regression verdict. | ||
--save-baseline | — | Save results as the new baseline (requires --baseline <path>). | ||
--resume <path> | — | Resume a previous run, adding more iterations to increase confidence. | ||
--threshold <frac> | 0.2 | Regression threshold (0.2 = flag if 20% slower). | ||
--production-build | — | Build a local bundled package via gulp vscode for comparison against a release baseline. | ||
--no-cache | — | Ignore cached baseline data, always run fresh. | ||
--force | — | Skip build mode mismatch confirmation prompt. | ||
--ci | — | CI mode: write Markdown summary to ci-summary.md (implies --no-cache, --heap-snapshots, --cleanup-diagnostics). | ||
--heap-snapshots | — | Take heap snapshots after each run (slow; auto-enabled in --ci mode). | ||
--gc-object-stats | — | GC deep-dives only. Enables V8 gc_stats tracing (per-type heap object dump on every GC). ⚠️ Corrupts all timing metrics — a major GC landing mid-request adds ~550ms — so never use it for benchmarking. Off by default; prefer heap snapshots for memory analysis. | ||
--cleanup-diagnostics | — | Delete heap snapshots, CPU profiles, and traces to save disk. During runs, only the latest run's files are kept; after comparison, files for non-regressed scenarios are deleted. Auto-enabled in --ci mode. | ||
--setting <k=v> | — | Set a VS Code setting override for all builds (repeatable). | ||
--test-setting <k=v> | — | Set a VS Code setting override for the test build only. | ||
--baseline-setting <k=v> | — | Set a VS Code setting override for the baseline build only. | ||
--verbose | — | Print per-run details including response content. |
Comparing two remote builds
Comparing two local builds
Both --build and --baseline-build accept local paths to VS Code executables. This enables apples-to-apples comparisons between any two builds:
Local path baselines are never cached (the build may change between runs). Version string baselines are cached for reuse.
Build modes and mismatch detection
The tool classifies builds into three modes based on the executable path:
| Mode | Source | Characteristics | |
|---|---|---|---|
dev | .build/electron/ (local dev) | Unbundled sources, VSCODE_DEV=1, NODE_ENV=development. Higher memory and startup overhead. | |
production | ../VSCode-<platform>-<arch>/ (from gulp vscode) | Bundled JS, no dev flags. Matches release characteristics but uses local source. | |
release | .vscode-test/ (downloaded via @vscode/test-electron) | Official published build. |
When test and baseline builds have different modes (e.g. dev vs release), the tool shows a warning and prompts for confirmation. Use --force or --ci to skip the prompt.
Using --production-build builds a local bundled package via gulp vscode for fair comparison against a release baseline. This eliminates dev-mode overhead while still testing your local changes.
Settings overrides
Use --setting, --test-setting, and --baseline-setting to inject VS Code settings into the launched instance. This is useful for A/B testing experimental features:
Precedence: --test-setting / --baseline-setting override --setting for the same key. Values are auto-parsed: true/false become booleans, numbers become numbers, everything else stays a string.
Resuming a run for more confidence
When results exceed the threshold but aren't statistically significant, the tool prints a --resume hint. Use it to add more iterations to an existing run:
--resume loads the previous results.json and its associated baseline-*.json, runs N more iterations for both builds, merges rawRuns, recomputes stats, and re-runs the comparison. The updated files are written back in-place. You can resume multiple times — samples accumulate.
Statistical significance
Regression detection uses Welch's t-test to avoid false positives from noisy measurements. A metric is only flagged as REGRESSION when it both exceeds the threshold AND is statistically significant (p < 0.05). Otherwise it's reported as (likely noise — p=X, not significant).
With typical variance (cv ≈ 20%), you need:
- n ≥ 5 per build to detect a 35% regression at 95% confidence
- n ≥ 10 per build to detect a 20% regression reliably
Confidence levels reported: high (p < 0.01), medium (p < 0.05), low (p < 0.1), none.
Exit codes
0— all metrics within threshold, or exceeding threshold but not statistically significant1— statistically significant regression detected, or all runs failed
Scenarios
Scenarios are defined in scripts/chat-simulation/common/perf-scenarios.js and registered via registerPerfScenarios(). There are three categories:
- Content-only — plain streaming responses (e.g.
text-only,large-codeblock,rapid-stream) - Tool-call — multi-turn scenarios with tool invocations (e.g.
tool-read-file,tool-edit-file) - Multi-turn user — multi-turn conversations with user follow-ups, thinking blocks (e.g.
thinking-response,multi-turn-user,long-conversation)
Run npm run perf:chat -- --help to see the full list of registered scenario IDs.
Metrics collected
- Timing: time to first token, time to complete, time to render complete (includes typewriter animation)
- Rendering: layout count, layout duration (ms), style recalculation count, forced reflows, long tasks (>50ms), long animation frame count and duration
- Memory: heap before/after, heap delta post-GC (informational, noisy for single requests)
- Extension host: heap before/after/delta via CDP inspector
Regression triggers vs informational metrics
Only these metrics trigger a regression failure (when they exceed the threshold with statistical significance):
timeToFirstToken,timeToComplete— user-perceived latencylayoutDurationMs— total layout time from the trace (the real layout cost)forcedReflowCount— forced synchronous layouts are always badlongTaskCount— main thread jank
These are reported but informational only (won't fail CI):
longAnimationFrameCount— number of long animation frames; noisy and compositor-driven, so tracked for signal but does not gate. Real jank is gated vialongTaskCount/layoutDurationMs.layoutCount— number of layout ops; inflated by CSS animations (compositor-driven, cheap). A build can do more but cheaper layouts, so gate onlayoutDurationMs, not this count.recalcStyleCount— number of style recalcs; inflated by CSS animations (compositor-driven, cheap)timeToRenderComplete— includes typewriter animation tail- Memory/heap metrics — too noisy for single-request benchmarks
Statistics
Results use IQR-based outlier removal and median (not mean) to handle startup jitter. The coefficient of variation (cv) is reported — under 15% is stable, over 15% gets a ⚠ warning. Baseline comparison uses Welch's t-test on raw run values to determine statistical significance before flagging regressions. Use 5+ runs to get stable results.
Memory leak check
Script: scripts/chat-simulation/test-chat-mem-leaks.js npm: npm run perf:chat-leak
Launches one VS Code session, sends N messages sequentially, forces GC between each, and measures renderer heap and DOM node count. Uses linear regression on the samples to compute per-message growth rate, which is compared against a threshold.
Key flags
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 7 Sep 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/chat-perf/SKILL.md
Popularity
- Repository stars
- 191,449
- Repository forks
- 42,038
- 7-day trend score
- 61
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/vscode/chat-perf)