Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

live-performance-audit

БесплатноЗапускает вложенные скриптыНе проверен

Measure where a slow DSH interaction (thread switch, New thread, any request over 250 ms) actually spends its time on the live Host and browser, then fix it…

astahmerот astahmer★ 21 звезда на GitHub

Об этом скилле

Live performance audit

Static audits, scratch fixtures and request logs alone have repeatedly produced the wrong plan here (new helper plugins, "core fork needed"). Start from the live GUI, attribute every millisecond, then fix the owner. The budget is 250 ms per interaction and per request on a Host that is not stalled.

1. Measure the live instance (read-only, no restart)

S=.agents/skills/live-performance-audit/scripts
node $S/host-lag.mjs 60                       # is the Host event loop itself blocked?
node $S/switch-probe.mjs 10                   # per sidebar click: composer, history, long tasks, DOM, bytes, requests
RTT=100 CPU=4 ROWS=6 node $S/phone-switch-probe.mjs   # phone: list tap -> title, first message; Back -> list; PROFILE_DIR=… adds profiles
REQUESTS=1 node $S/switch-probe.mjs 5         # every request a click fires, with its time
MATCH='^Exact thread title' DUMP=snap.json node $S/switch-probe.mjs 1 && node $S/snapshot-bytes.mjs snap.json
# Resolve and verify exactly one Host PID from the current runtime first:
node $S/host-cpu-profile.mjs "${DSH_HOST_PID:?set the verified Host PID}" 60   # SIGUSR1 inspector, closed afterwards

For a page load, record the HAR yourself instead of asking the user for one. har-capture.mjs loads the live GUI read-only in a headless Chromium (the same ~/.dsh/runtime/web-url entry the probes read) and writes a redacted HAR: no headers, cookies, query strings or response bodies, request bodies replaced by digests, mode 600. A /api/dshx-batch POST keeps each call's endpoint (dshx-<channel hash>/<method>), an envelope digest and the size of its answer line, never the payload or the answer:

node $S/har-capture.mjs --seconds 60 --summary                 # one fresh load, summarized
node $S/har-capture.mjs --tabs 3 --seconds 60 --out $SCRATCH/three-tabs.har   # three pages share one socket pool
node $S/har-summary.mjs <capture>.har                        # --json for the raw summary, --top N for more methods
# Per-plugin request census, same workload before and after a fix: idle, thread switches, then panels by role:name.
node $S/har-capture.mjs --seconds 15 --switches 6 --visit 'tab:Work>button:Backlog' --visit 'tab:Land>button:History' --initiators
MATCH='^Thread title' node $S/reload-probe.mjs 3              # reload to interactive, cold and warm HTTP cache (PROFILE_DIR=… adds CPU profiles)
node --test $S/har-capture.test.mjs $S/har-summary.test.mjs

A headless capture has no other user tabs or their event streams, so it measures the page itself; --tabs N reproduces several tabs. The user's own browser state (extensions, every open tab) still needs their DevTools export when the two disagree. Status -1 marks reads still open when the capture ended.

It prints requests, how long until the first request left the browser queue, blocked (queue) and wait (server) p50/p95, requests aborted before being sent, duplicate method + body calls, bytes, and the top methods with the plugin that owns each dshx channel (every @dshfiles/* package × API id in the repository, hashed with dshx's ApiChannelModel.apiChannel). A batch counts as one request in the totals and expands into its calls in the method table (batched, maxKB, and every·s, the median interval between calls, which names a repeating poll or event re-read). It never prints headers, cookies, bodies, query strings or the page URL. Request time far above wait means the browser queue: what holds the six HTTP/1.1 sockets (other tabs, the shared-streams worker's EventSources, slow reads) is only visible in the user's browser, through chrome://net-export with the tab count noted. The HAR's _initiator.stack names the calling function when a core method has several possible owners.

The residency probe is scratch-only (it snapshots the page heap and refuses the live origin): it visits sidebar threads like a long-lived tab, then reports the Session Controller's resident instances by retain source, open session/follow streams, page heap after GC and what one reconnect sends. ASIDE=1 also opens each visited thread's next row in the side panel, which is what makes keep-mounted bodies accumulate.

LAUNCH_URL=<scratch launch url> ASIDE=1 node $S/session-residency-probe.mjs 14

A long-lived tab and the client work each switch repeats, also scratch-only. Seed representative threads first (copying private logs needs the person's authorization; the copy and what it yields stay out of the repository), then switch through the same ids before and after a fix:

STATE=$TMPDIR/dshx-dev/<name>/state.json
node $S/seed-session-logs.mjs --from ~/.dsh/sessions/--<project>-- --source-cwd <project dir the logs recorded> \
  --home "$(node -p "require('$STATE').home")" --project "$(node -p "require('$STATE').project.path")" > $SCRATCH/ids.txt
export LAUNCH_URL="$(node -p "require('$STATE').launchUrl")" IDS=$SCRATCH/ids.txt
node $S/registry-churn-probe.mjs 10
Полный SKILL.md на GitHub

Установить live-performance-audit в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

scripts/boot-probe.mjsscripts/follow-stream-probe.mjsscripts/har-capture.mjsscripts/har-capture.test.mjsscripts/har-summary.mjsscripts/har-summary.test.mjsscripts/heap-snapshot-retainers.mjsscripts/host-cpu-profile.mjsscripts/host-lag.mjsscripts/lag-under-load.mjsscripts/long-tab-heap-probe.mjsscripts/mirror-probe.mjsscripts/phone-switch-probe.mjsscripts/registry-churn-probe.mjsscripts/reload-probe.mjsscripts/seed-session-logs.mjsscripts/session-residency-probe.mjsscripts/snapshot-bytes.mjsscripts/switch-probe.mjs

FAQ

Что делает скилл live-performance-audit?

Measure where a slow DSH interaction (thread switch, New thread, any request over 250 ms) actually spends its time on the live Host and browser, then fix it at the owner — usually an owned plugin or a fork of the native Loader row, not a new plugin or a core patch. Use before planning any performance work, whenever the user reports seconds-long requests or a laggy GUI, and to prove a fix with before/after numbers.

Как установить скилл live-performance-audit?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл live-performance-audit запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить live-performance-audit с