Preface¶
When building Web client plugins or debugging session UIs in DeepSeek Harness (DSH), the common dilemma isn’t “is there a DevTools”, but “that jank just happened and I didn’t have Performance open”. DSH’s built-in experimental developer tools lean toward a front-of-stage microscope: breakpoints, Host console, network capture, session logs, Cordis tree; the Client-side Performance panel only samples Host CPU, and does not provide page rendering traces or frame data. If you need something that stays on by default and can answer afterwards “is it smooth now, who caused the jank, is it a plugin or the host/link”, you need a resident client-side dashcam. Below we introduce the community plugin dsh-perf-hud (maintainer: yanzhaohui1999, category: client).
What is this¶
dsh-perf-hud is a pure client-side performance HUD: a bottom-right overlay that answers “is it janky right now, and who is causing it”. It records frames and worst frames, Longtasks (including four-leg attribution), per-plugin callback rates and sync durations, DOM growth and writers, JS heap, host event-loop and link RTT, and provides isolated experiments and one-click JSON export. There is also a “watchdog” layer: during sporadic jank it automatically preserves the worst few incidents, and all evidence can be exported at once. The current npm version is v0.6.0, MIT licensed; the README states compatibility with DSH 0.2.1-rc.1.
Division of labor with DSH’s built-in developer tools¶
| Question to answer | More suitable tool |
|---|---|
| Why is it slow right now; breakpoints, network, session logs, Cordis tree | DSH developer tools (plugin manager official groups: NodeJS diagnostics / Session data diagnostics) |
| How slow that hit just now was; who did it; can it be reviewed | dsh-perf-hud |
The two sides do not depend on each other. Installing this plugin will not fill in the missing devtools-trace in the DevTools incident bundle; the developer tools capture full-volume Host fetches (including secrets), while this plugin does “subtraction sanitization before export” — these are two different regimes.
Shortcut: Cmd/Ctrl+Shift+U to expand/collapse (macOS / Windows); the Linux Web platform whitelist has not bound this combination. Collapsing/expanding does not steal focus from input boxes.
Core features¶
What the panel can answer¶
| Question | Answer from the panel |
|---|---|
| Is it smooth right now? | FPS / worst frame / unattributed time within frames; the title bar always shows “streaming / idle Ns” as the interpretive premise |
| Who caused that jank? | Longtask details + four-leg attribution (component name / package name / DOM writer) |
| Which plugin is doing hidden work? | Per-plugin callback execution rate (/s), peak rate, sync duration; DOM write count and writers |
| Is it the plugin or the host/link? | Host event-loop p50/p99/max + link RTT/throughput, with threshold-based coloring and a “link excluded” conclusion |
| Does turning off a plugin help? | Isolation experiment (console): turn plugins off one by one for 60 seconds, compare with the adjacent baseline, and give the noise floor |
Watchdog layer (sporadic jank)¶
The panel needs a human watching it, and sporadic jank often happens when nobody is looking. By default the plugin keeps a non-instrumenting recorder layer running:
- Every frame is written to a frame-level ring buffer (about 12000 entries, about 3.3 minutes at 60fps), and a LoAF observer is mounted (Chrome 123+).
- If a single frame exceeds 100ms, or LoAF’s
blockingDurationexceeds 100ms, it is automatically captured: the 10 seconds before + 3 seconds after, sliced as-is. - Retention policy: the global worst 10 + one worst per day (up to the most recent 7 days), as a union; there is a 2MB byte cap on what is written to disk, and when exceeded entries are trimmed from the weakest, with the trimmed count shown in the always-visible row “trimmed N”; the data is still readable back after a refresh or browser restart, and
watch().restoredindicates how many entries were read back this time. - “Detected”, “coalesced (same burst)”, “scene saved”, and “lost” categories are separated; the “detected N times” on the collapsed pill refers to the most recent 24 hours (across refreshes), not the number of retained copies.
- rAF suspension gaps caused by the tab being hidden do not count as jank; incident bundles are marked as
gap. This layer does not wrap any prototypes, and uses only rAF andPerformanceObserver.
Four-leg attribution and forensic details¶
Longtasks and long animation frames can be decomposed into dimensions such as script, task, render, style+layout+paint; the script side is further attributed by LoAF’s invoker (by source) and package name (merged batches rely on sourcemap segments). When deep capture (precise attribution) is off, blocks such as callback attribution and DOM writes are shown in a degraded state as “deep capture required”, avoiding misreading an un-instrumented state as zero overhead. Historical incident frame timeline data comes from the incident bundle itself, remains valid after refresh, and adds no collection cost.
Isolation experiments¶
Isolation experiments have moved to the console API, for turning plugins off one by one for about 60 seconds and comparing with a baseline (README TOC entry: “Isolation experiments (moved to console)”).
Installation and activation¶
v0.6.0 has been published to npm. Under the Web profile, run:
dsh plugin --profile web add dsh-perf-hud
The plugin declares itself as a Web client with immediately: true in package.json, and is injected into the client slot via a Cordis patch; after installation it loads with the DSH Web client, and the HUD is on by default (including the watchdog layer).
Typical usage¶
Console API¶
In the browser console (the global object exposed by the plugin), you can query watchdog status, incident summaries, and export:
__perfHud.watch() // 在不在录、覆盖多少秒、LoAF 是否安装、抓到几次
__perfHud.incidents() // 最差几次的摘要(索引 0 最差)
__perfHud.report(0) // 完整事故包:帧序列 + LoAF + 窗口内 longtask + 环境读数
__perfHud.exportIncident(0) // 下载 JSON,文件名形如 perf-hud-20261008-220358-i84.json
__perfHud.capture('切了视图') // 手动标记「刚刚卡了一下」(自动回退约 3 秒)
__perfHud.clearIncidents() // 只清事故;clear() 刻意不动守夜数据
When the statistical regime matches what the panel shows on hover, you can use __perfHud.tally().
Panel operation notes¶
- Above the ring
frame 1/12 · 530ms · ≥100ms ◀ ▶ ⟲: sorted byframeSeverity = max(blocking, frame duration); ◀ ▶ pins a particular entry, ⟲ returns to auto-following the worst. - “Forensic details” contains a 60-second frame bar: clicking a second cell that has a long animation frame jumps to the corresponding frame; a full-second rAF suspension is shown as a gray bar (gap).
- To enter a historical incident from live monitoring use “view this frame”, and to return to live use “back to live”; the context is persisted to disk, and after refresh it tries to keep the same incident and frame.
Applicable scenarios and cautions¶
Who it is for: Developers working in the DSH Web client on plugins, session UIs, streaming rendering, and event-loop issues, who need resident frame-level observation, Longtask attribution, plugin callback and DOM write statistics, and the ability to export JSON evidence bundles after sporadic jank for post-hoc analysis.
Permissions and trust: The plugin runs in the client with the current DSH process permissions, continuously observes page performance, and may persist incident bundles to local storage. Before installing, read the GitHub repository source code and the MIT license, and read the “Risks and boundaries (must read)” section in the README: for example, export-time sanitization differs from the DevTools capture regime; page-internal function-level sampling cannot replace Chrome trace; some UI interactions have been disabled for stability reasons; etc.
Environment boundaries: LoAF depends on Chrome 123+; Linux Web has not bound Cmd/Ctrl+Shift+U. The number of watchdog retention entries is capacity-limited, so you cannot answer “how many janks recently” from the list count alone — jank that got squeezed out may still have occurred at the counting layer.
Links¶
- Community catalog page: skillhub.cn/plugins/yanzhaohui1999/dsh-perf-hud (independent community site, no official affiliation with DeepSeek / High-Flyer)
- Source code and documentation: github.com/yanzhaohui1999/dsh-perf-hud
The DSH ecosystem philosophy is “everything is a plugin”; dsh-perf-hud fills the gap of a resident client-side performance HUD and watchdog incident bundles, with a clear division of labor with the official developer tools. It is suitable as a dashcam during daily development, and after jank occurs you can use exportIncident to hand the scene over to human or agent analysis.