dsh-perf-lens: Plugin-Attributed DSH Resource Consumption Panel

Preface

In DeepSeek Harness (DSH), every host plugin runs within the same Node process. When checking resource usage with system tools, you can only see the total CPU, memory, and disk usage of the “entire process.” It is difficult to answer “which specific plugin is slowing down the machine.” Writing temporary profiling scripts works as a stopgap, but once the panel is closed and the issue passes, the attribution trail often breaks.

dsh-perf-lens is a client-side DSH plugin released by maintainer Nwflower. It samples within the process, attributes overhead to the plugin that triggered the stack, and displays this in the Perf Lens panel within the dsh web GUI. On the browser side, it utilizes the Long Animation Frames API (falling back to time correlation when unsupported) to attribute long-frame script time to specific plugins, allowing you to identify “which plugin is causing page jank.” The following sections cover what it is, what it monitors, how to install it, how to tune sampling, and what to watch out for when reading metrics.

What is this

dsh-perf-lens is positioned as: A DSH plugin panel showing which plugins use the host CPU, memory, and disk, attributed per plugin.

Environment Requirements

Before installing, confirm that the host environment meets the constraints in the README and package.json:

  • DeepSeek Harness 0.1.7-alpha.1 or higher, using the Web GUI (dsh web)
  • Node.js 22.13 or higher (matching the Node version running the DSH host)

Core Functions

After opening Perf Lens on the left side of the Web GUI, the panel roughly includes the following views (UI language follows the GUI’s English/Chinese setting):

Process overview

Displays RSS, heap, event loop delay, GC pauses, idle ratio in recent windows, etc. It also supplements readings the host cannot provide alone: child process tree (count, total CPU/memory), CPU not accounted for by sampling, and async resources held by the process.

Cost composition

The proportion of CPU and sampled heap occupied by each plugin across the entire process scope.

Top consumers

The plugins with the highest current overhead, including average and peak values.

Trend

CPU trends by plugin over the last hour, day, or week.

Cumulative cost ranking

Ranking of cumulative CPU consumption within the selected time range.

Plugin detail

All plugins can be grouped and sorted; the heaviest harness packages can be expanded; in deep mode, hotspot functions for each plugin are visible. It also includes listeners (from the cordis event registry, exact) and on-disk bytes (scanning $DSH_HOME and plugin directories, exact).

Foreground jank

Long tasks and frame drops in the browser; long-frame script time is attributed by plugin (via the Long Animation Frames API) and displayed alongside what the host was busy with at that time. Browsers without this API use plain time correlation. In the DSH Desktop window, if the browser does not provide this attribution, the jank probe switch can be used to measure the main thread usage caused by scheduled callbacks from each plugin (in milliseconds, call count, and longest single call).

Installation and Enablement

The plugin is not yet published to npm; it needs to be registered to a profile from local build artifacts following the official README (steps below; replace paths with actual directories on your machine).

First, clone and build locally (producing lib/, including host and single-file client bundle):

git clone https://github.com/Nwflower/dsh-perf-lens.git
cd dsh-perf-lens && pnpm install && pnpm build

Edit ~/.dsh/profiles/web/package.json in the default web profile, add the bundle to dsh.profile.bundles, and point to the local path using link::

{
  "dsh": { "profile": { "bundles": [ /* … existing bundles … */, "dsh-perf-lens" ] } },
  "dependencies": { "dsh-perf-lens": "link:D:/path/to/dsh-perf-lens" }
}

Install profile dependencies and restart the Web service:

cd ~/.dsh/profiles/web && pnpm install

The host side loads at server startup, so restarting dsh web is required for it to take effect. The README notes: Once published to npm in the future, the dependency can be changed to "dsh-perf-lens": "^0.1.0" with no local build needed. If the profile’s pnpm minimumReleaseAge policy blocks the installation, you can run pnpm install --config.minimumReleaseAge=0 once instead of changing global profile settings.

Typical Usage: Sampling Intensity Selection

Sampling itself has a cost. Perf Lens uses short-window sampling and determines “what is actually running” through a combination of three controls—the panel displays the actual current running combination, not just the button state.

Intensity (One of three levels)

Level Behavior Applicable Scenario
Low (Default) A 5-second window every 30 seconds or longer; falls back to 2 minutes when the host is idle, with a cheap 1-second check every 10 seconds to avoid missing bursts Always-on
High Continuous 2-second windows; reverts to Low after 10 minutes When actively watching the panel to troubleshoot
Stop No new windows open When you want the host to be completely undisturbed by foreground sampling

Background sampling (On/Off)

Only meaningful when Intensity is Stop: When enabled, it still performs a coarse-grained 2-second window every 2 minutes, retaining long-term records even if the panel is closed. Under Low/High, it duplicates foreground sampling and has no additional effect.

Memory sampling (On/Off)

Overlays heap sampling onto any running window for memory attribution, per-plugin hotspot functions, and accounting for work scheduled via harness callbacks; it is the most expensive option and the only item billed extra on top of CPU sampling.

Common combinations (from the README):

  • Stop + Background On: Cheap long-term recording
  • Low + Memory On: Daily profiling
  • High + Memory On: “I am watching this specific area in real-time”

Any changes take effect immediately; the three settings are reported by the host and remain consistent after refreshing the page.

Readings and Limitations

Share vs. Absolute Value

A plugin’s share is its proportion of the CPU actually used by the process within that window. When the host is idle, the denominator is very small, so even a few milliseconds of work might show 90%. The panel also provides absolute costs: milliseconds of CPU per second and single-core percentage—when comparing across time or machines, prioritize absolute values.

Attribution Rules

Each sample traces back along the call stack to the nearest plugin frame, so dependencies called by the plugin and Node built-ins are attributed to that plugin. Harness built-ins merge framework self-work into one row; Runtime (GC, native/syscall, Node internals, event loop, etc.) covers work with no plugin frame on the stack; This plugin’s overhead is Perf Lens itself. Items that are sampled rather than precisely measured are marked; the cumulative ranking hides full-range estimates that cannot be honestly extrapolated when sampling coverage is insufficient. The Jank table shows the proportion of attributable script time; unresolvable combo bundles fall into the Unresolved row without guessing.

Known Limitations (Selected)

  • No per-plugin RSS: There is only one RSS per process; memory numbers come from sampled heap allocations in deep mode, not the physical footprint of each plugin.
  • Child processes: Displayed only, not attributed: The overview reports the total overhead of host descendants; which plugin spawned a child process is not yet measured; child processes started/stopped within the polling interval may not be visible (targeted at long-lived descendants like language servers, dev servers, terminals, builds). On Windows, each poll takes about 330ms wall time, defaulting to once every 30s, with an immediate refresh when the panel opens.
  • Disk bytes read/written not measured: Per-plugin file operation counts and on-disk usage (scanning $DSH_HOME and plugin directories) are exact; read/write byte volume is not. Scanning does not follow symbolic links; files pointing outside the two roots via a chain may show as empty.
  • Timers and handles are currently process-level only (The README is truncated here; refer to repository documentation for details).

Applicable Scenarios and Notes

Suitable for: Developers and plugin authors using the DSH Web GUI who want to observe “which plugin is eating CPU/heap/disk/listeners” over the long term or on-demand, compare trends and cumulative rankings, and correlate browser jank with host load.

Notes:

  • The plugin runs in the same Node process and with the same permissions as the DSH host; please review the source code and MIT license at https://github.com/Nwflower/dsh-perf-lens before installing.
  • The community directory SkillHub is an independent site with no official affiliation with DeepSeek / High-Flyer; facts in this article are based on the repository README and package.json.
  • Directory metadata such as star counts may change; refer to each site’s current display.

Conclusion

dsh-perf-lens consolidates the problem of “can’t see clearly through the whole process, temporary scripts are hard to maintain” into a configurable sampling and per-plugin attribution panel within the Web GUI: host-side CPU/heap and disk-related metrics, browser-side jank, and precise columns like listeners and on-disk usage, making it easier to locate the source of overhead as plugins increase.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye