Skip to content

Commit 0a05be7

Browse files
authored
Merge branch 'main' into alexr00/honest-ferret
2 parents 0cd8f30 + f836075 commit 0a05be7

238 files changed

Lines changed: 14003 additions & 5269 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/skills/auto-perf-optimize/SKILL.md

Lines changed: 276 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!README.md
3+
!.gitignore
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Scratchpad — one-off scenario runners
2+
3+
This folder is gitignored. Write investigation-specific runners here freely.
4+
5+
## Organization
6+
7+
Put each investigation in a **dated subfolder** named `YYYY-MM-DD-short-description/`:
8+
9+
```
10+
scratchpad/
11+
2026-04-09-chat-scroll-leak/
12+
scenario.mts
13+
findings.md
14+
2026-04-12-editor-tab-switching/
15+
scenario.mts
16+
findings.md
17+
```
18+
19+
Each subfolder should contain:
20+
21+
- **Scripts** — scenario runners, analysis scripts, etc.
22+
- **`findings.md`** — a summary of the investigation: all ideas considered, whether each led to a change or was rejected (and why), and before/after measurements so the user can review decisions and follow up.
23+
24+
Scenario runners you create here can import utilities from the checked-in
25+
scripts or copy patterns from them. When a runner proves generally useful,
26+
promote it to the parent `scripts/` folder.
27+
28+
## Quick start
29+
30+
```bash
31+
# Write a runner
32+
cat > scratchpad/my-scenario.mts << 'EOF'
33+
import { chromium } from 'playwright-core';
34+
// ... your scenario
35+
EOF
36+
37+
# Run it
38+
node .github/skills/auto-perf-optimize/scratchpad/my-scenario.mts
39+
```
40+
41+
## Checked-in scripts (in `scripts/`)
42+
43+
These are reusable, generic runners. Use them directly or as templates:
44+
45+
- **`chat-memory-smoke.mts`** — Multi-turn chat smoke runner. Sends prompts,
46+
waits for responses, samples heap, takes optional snapshots. Supports
47+
`--message`, `--iterations`, `--skip-send`, `--keep-open`, `--reuse`, etc.
48+
49+
- **`chat-session-switch-smoke.mts`** — Creates multiple chat sessions with
50+
different content, then repeatedly switches between them via the sessions
51+
sidebar. Measures per-switch memory growth.
52+
53+
- **`userDataProfile.mts`** — Utility for managing user-data profiles in
54+
smoke test runs.
55+
56+
## Tips
57+
58+
- Always use `--user-data-dir .build/auto-perf-optimize/user-data` (the
59+
persistent profile with Copilot auth). Never create a fresh user-data-dir.
60+
- Use `--skip-prelaunch` to avoid re-downloading Electron on every run.
61+
- If you need to clean up an orphaned test instance, stop only the specific
62+
Code - OSS process (e.g. by killing the PID that was logged at launch, or
63+
`lsof -ti :<port> | xargs kill`). Avoid `pkill -f 'Electron'` — it can
64+
kill unrelated Electron apps.
65+
- For heap snapshot analysis, use the `heap-snapshot-analysis` skill's
66+
scratchpad and helpers.

0 commit comments

Comments
 (0)