test(terminal): profile webgl render stages

This commit is contained in:
zhangheng
2026-06-24 17:46:54 +08:00
parent 7593561761
commit a039f7fd5f
7 changed files with 204 additions and 20 deletions

View File

@@ -251,6 +251,10 @@
- `240x100`WebGL `92.48 rows/sec`frame p95 `399.9ms`Canvas `157.65 rows/sec`frame p95 `116.8ms`
- 两种 renderer 的 pixel smoke 均通过Canvas 可直接读取 canvas 像素WebGL 走 screenshot smoke。
- 当前策略:默认 CanvasWebGL 继续通过页面切换、`?renderer=webgl``--renderer webgl` 保留优化回归入口。
5. **WebGL renderer profiling / 慢路径拆解**
- WebGL render path 记录阶段耗时DOM/canvas 同步、backdrop 绘制、glyph collect、backdrop texture pass、glyph atlas、atlas upload、vertex build/upload、draw call。
- 记录计数cells、atlas entries、atlas insertions/resets、full-canvas fallback 次数、glyph draw failed 次数。
- `window.__terminalBench.webglFrames` 暴露每帧采样,`scripts/terminal-bench.mjs` 汇总为 `rendererStats`,用于判断慢点是整屏 backdrop texture、atlas、vertex buffer还是 fallback。
---