Repository navigation
perf: reduce idle work, audio memory and move latency - #37
Merged
Merged
Conversation
Update sharp, source-map-js and the oxfmt tinypool dependency. Pin a private local braces fork to the depth-limit patch in upstream PR 78 while no fixed registry release exists, with complete provenance and license metadata. Keep the audit gate and add reduced-stack regressions through the installed micromatch dependency. Verified npm ci with Node 22.13.0/npm 10.9.2, zero audit findings, 908 upstream tests, static checks, unit/runtime tests, production build, model tools and CI browser flows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
降低等待落子时的持续绘制、音频与模型内存,以及开局、选子、吃子和切换画质时的主线程开销;棋局规则、存档格式和 AI 节点预算保持一致。
Related: #30, #35
同机 M1 Max、可见 Chromium、1920×1080 的有限样本;前期审计基线为
2819496a,本轮补充基线为173301af,不能全部当作相对当前 main 的独立 A/B:LOD1/2 阵营几何合计少复制约 10.16 MiB CPU 数据;此数不是 GPU 显存实测。PCM 不含原生媒体内部缓冲,交接淡出期间仍会短暂持有旧缓存。详细证据和历史失败记录见性能修正记录。
Validation
npm run typechecknpm run lintnpm run test:bundlewhen client imports or dependencies change独立代码审查完成,无待修问题(
status: complete,记录20261002-064801-b4c9f3a6)。灯光数量目前由程序编译次数和吃子运行时采样间接验证,尚无覆盖所有状态的直接数量断言。本地验证:
npm test、npm run test:bundle通过:4 项生产 HTML/响应合同检查、3 项 JS 预算测试;本次依赖更新后初始 JS 静态闭包 443.6 KiB gzip,预算通过。正式性能门槛沿用前轮已记录的口径:走子/巡游独立采样、平均帧间隔 ≤17.5 ms,场景 p95 取同次空闲 rAF p95 +1 ms 且封顶 20.24 ms;AI p95 ≤20.24 ms,并检查最大帧和表现长任务。本轮未放宽门槛,也不声称通过原来的固定 p95 ≤16.7 ms 门槛。
2026-10-07 CI 修复复验:Node 22.13.0 / npm 10.9.2 下重新执行
npm ci,依赖审计 0 告警;405 项单元/运行时测试、2 项依赖安全回归、908 项上游 braces 测试、构建与预算、模型优化工具通过。CI 对应浏览器流程为生产 12 项、渲染 3 项、在线对弈 1 项通过;100 次开局压力测试仍按常规 CI 配置跳过。Visual and asset changes
最终截图复验全部通过,本轮无需更新基线。前轮已人工检查并更新 6 张低画质基线,说明见性能记录。
桌面截图 · 移动截图
Risk
Supply chain and security
此前 CI 的依赖审计发现已处理:
brace-expansion2.1.4 → 2.1.7、fast-uri3.1.6 → 3.1.8,对miniflare@5.20260903.0-alpha定向覆盖undici7.29.0 → 7.29.1。直接 Cloudflare / Wrangler 版本不变,三者许可证仍为 MIT;未改审计门槛或工作流权限。本次 CI 修复将
sharp更新为 0.35.5、source-map-js更新为 1.2.2,并将 oxfmt 使用的tinypool固定为 2.1.2。braces的深层嵌套栈溢出尚无官方修复版本,因此暂用私有本地补丁包:从 上游 PR 78 的固定提交逐字节引入运行时代码,保留 MIT 许可证、来源哈希和替换条件,详见 补丁来源说明。两个构建工具调用链均解析到该补丁。npm 不按 registry 发布包扫描本地链接源码,因此审计 0 告警不能单独证明补丁安全。CI 保留原
--audit-level=high门槛,并新增通过实际 micromatch 依赖路径运行的深度字符串/AST 回归;旧版本已复现栈溢出,补丁返回受控错误。该补丁来自尚未合并的上游提案,需在官方修复发布后替换。