崮生(子虚) 2834c4d4ab perf(cff): Local Subr INDEX 改轻量头部按需读 offset,subsetCFF -59%
subsetCFF 之前对命中的 Local Subr INDEX 做全量 readIndex(解析 count+1 个
offset),思源 FD12 26550 subr 这步耗 0.181ms,占 subsetCFF 一半。
但引用收集与重建只按 subr 编号读个别 offset(思源仅引用 13 个)。

新增 readIndexHeader(只读 count/offSize/dataStart + 末尾哨兵算 end)+
readIndexOffset(按编号 i 读单个 offSize 字节 offset),替换全量解析。

收益:
- subsetCFF 0.3466→0.1411ms (-59%)
- otf-思源黑体 woff2 min 1.50→1.30ms (-13%)、ttf 1.75→1.20ms (-31%)
- 输出字节完全一致(19188/10664 bytes),SSIM 保持 1.0000

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 01:05:35 +08:00
..
2026-04-08 22:05:17 +08:00
2024-08-19 18:10:09 +08:00