awa-123-cw/dsh-webui-perf

DeepSeek Harness WebUI性能优化开关插件:长代码流式渲染/历史加载/高亮缓存优化,设置面板一键开关(含官方包补丁)

Project Overview项目介绍

This is a native performance optimization plugin built exclusively for the DeepSeek Harness (DSH) web UI, covering optimizations for multiple common performance bottlenecks. It addresses issues ranging from streaming rendering of long code blocks to loading large history sessions, syntax highlighting caching, memory management, and image loading optimizations. All optimizations are controlled by a single toggle in the DSH settings panel, so users can enable the improvements or revert to the original official implementation with one click at any time without reloading the page.

Installation requires two main steps: first, apply the provided source patches to your local DSH source code, then add the plugin to your DSH web profile dependencies and bundles list. You can apply patches either when building DSH from source, which is the recommended method for long-term maintenance, or to an already installed DSH environment for a no-build setup. If you ever need to remove the plugin, you can roll back all patches and remove the plugin entry from your profile, then restart DSH to complete the removal.

This plugin is currently compatible only with DSH versions 0.1.0-rc.5 and 0.1.0-rc.6, and all 1021 official DSH tests pass with the plugin installed. After any official DSH upgrade, you need to run the included patch health check script to confirm your patches are still applied correctly, because official upgrades often overwrite patched files in the node_modules directory. If patches are missing, the settings panel will show a red warning prompting you to reapply the patches, and the plugin is released under the open source MIT license.

这是一个专为 DeepSeek Harness (DSH) 开发的原生性能优化插件,用于优化DSH WebUI的各类性能问题,覆盖长代码流式渲染、历史会话加载、语法高亮、公式渲染、内存占用等多个常见场景的优化,所有优化功能统一收敛到一个设置面板开关,用户可随时一键开启优化或回退到官方原始实现。

该插件适合经常打开长历史会话、处理大段代码的DSH用户,实测打开长代码历史会话时的主线程冻结时间从8.3秒降低到0.3秒,减少了96%的卡顿。插件采用带开关的源码补丁形式发布,因为核心优化点位于DSH官方包内部,普通插件无法直接替换,开启开关后优化生效,关闭则立即回退到原始官方实现,无需刷新页面。

该插件兼容DSH 0.1.0-rc.5和0.1.0-rc.6版本,安装需要先给DSH源码打补丁,再将插件本体添加到DSH的web配置文件中,重启DSH即可使用。DSH官方升级后需要运行补丁健康检测脚本,确认补丁状态正常,避免开关失效。本插件采用MIT许可证开源。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:awa-123-cw/dsh-webui-perf

把 awa-123-cw/dsh-webui-perf 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-webui-perf 🐳⚡

DeepSeek Harness Web GUI 性能优化开关插件:长代码流式渲染、历史加载、语法高亮/公式/渲染缓存的优化,全部收敛到一个设置面板开关,随时一键开启或回退原始实现。

✨ 优化内容(开关开启时生效)

场景 优化
流式输出长代码 未闭合代码块增量解析(每帧只处理新增字节,O(n²)→O(n))
长代码写完瞬间 大代码块(>3000 字符)改空闲回调懒高亮,不再同步阻塞主线程
载入长历史会话 增量可见性判断(去掉每 chunk 的全文本 trim/rope 展平);工具调用树深度检查去 BFS
长思考(Think 块) 展开正文 100ms 节流更新,折叠摘要保持实时
重复渲染 shiki 高亮 / KaTeX / settled markdown 渲染三层 LRU 缓存
读大文件 ReadBlock 折叠时只高亮可见窗口(head/tail 16 行)
内存/显存 消息列表 content-visibility(离屏行跳过渲染/布局,长会话内存有界 + 滚动流畅);历史图片缩略图降采样到 ≤640px + 可见性门控(离屏图不加载);缓存上限收紧(>64KB 不缓存)
主动内存清理 右上角常驻 系统可用/总内存指示 + 🧹/♻️ 双档清理(PCL「内存优化」的 WebUI 对应):🧹 由 host 执行系统级 PowerShell 清理(EmptyWorkingSet 清 dsh 自身 + Edge 缓存进程 + 页面缓存/GC);♻️ 二次确认后深度清理(清所有 Edge 渲染进程工作集 + 刷新页面),实测 Edge 渲染进程单次释放 405MB(多标签可达数 GB)

实测:打开长代码历史会话的主线程冻结从 8.3s → 0.3s(-96%)。

📦 结构

dsh-webui-perf/
├── package.json            # 插件清单(host + client 双面)
├── cordis.patch.yml        # bundle patch(挂载到 web profile)
├── lib/
│   ├── index.js            # host half:注册 webui-perf 设置命名空间
│   └── client.js           # 浏览器 half:设置开关行 + localStorage/事件广播
└── patches/
    ├── dsh-webui-perf.patch        # 对 deepseek-harness 源码的补丁(git apply)
    ├── apply-patches.mjs           # 源码补丁应用/回滚脚本
    ├── apply-runtime-patches.mjs   # 已安装环境的运行时补丁(api-proxy allowlist)
    └── check-patches.mjs           # 补丁健康检测(升级后必跑)

为什么需要补丁:优化代码在官方包内部(ui-primitives 是 shell 平台模块、ui-conversation/ui-trajectory 是官方 client bundle,插件无法替换),因此优化以带开关的源码补丁形式随插件发布;插件本体负责开关 UI 与状态广播(localStorage + dsh:webui-perf-change 事件,cordis-free 通道)。关闭开关即回退官方原始实现。

🚀 安装

1. 应用官方包补丁

方式 A:源码构建(推荐,可长期维护)

# 在 deepseek-harness 源码 checkout 里
git clone --depth 1 https://github.com/deepseek-ai/deepseek-harness.git
cd dsh-webui-perf/patches
node apply-patches.mjs <源码路径>      # git apply --check + apply(自动备份语义,可 --reverse 回滚)

# 重新构建
cd <源码路径>
npm run build:lib:client
pnpm --filter @deepseek-ai/dsh-web-frontend run build
# 部署 dist 到 dsh-web-frontend/dist,lib/client.js 到各 client 包 lib/

方式 B:已安装环境(免构建)

node patches/apply-runtime-patches.mjs    # 打 api-proxy allowlist(自动备份)
# 再把构建好的 dist 与 client bundle 部署到 node_modules 对应包

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-finance-db 下一个 Next kph →