perf(terminal): cache webgl row vertex templates

This commit is contained in:
zhangheng
2026-06-24 21:18:32 +08:00
parent fb54acf88b
commit 057d74d44c
4 changed files with 225 additions and 53 deletions

View File

@@ -263,6 +263,9 @@
- WebGL renderer state 增加可见行 glyph 拆分缓存,相同行内容 / 样式 / theme 在滚动和连续输出时复用 grapheme 拆分结果。
- `GlyphKey.text` 改为 `Rc<str>`,缓存命中后 materialize 行 glyph cell 时避免反复复制 glyph 字符串。
- benchmark `rendererStats` 新增 `rowCacheHits` / `rowCacheMisses`,用于判断 `collectMs` 是否被 cache 命中率拉低。
8. **WebGL row vertex template cache**
- atlas 覆盖后按行缓存 glyph vertex template后续帧只按当前 row y 偏移 materialize减少每帧 atlas lookup / UV 计算 / quad 构建。
- benchmark `rendererStats` 新增 `vertexCacheHits` / `vertexCacheMisses`,用于判断 `vertexBuildMs` 是否主要来自 cache miss。
---