崮生(子虚) 67d2eb5fa5 perf(woff2): ttf→woff2 跳过 TTF checksum 计算
woff2 重新编码,不消费 TTF directory 的 per-table checksum 与
head.checkSumAdjustment(encodeTTFToWOFF2 只读 directory 的 tag/offset/length,
重建自己的 directory)。TTFWriter 加 skipCheckSum 选项,font.write 的 woff2
分支传入,跳过 checkSumArrayBuffer 调用 + directory 回填 + head adjustment。

node --prof 思源 3500 字大字集:checkSumArrayBuffer 5.1%(JS nonlib 第二大)
从热点列表消失。端到端 min -2%(brotli 主导稀释收益),但消除的是语义上
纯无用的计算(被 woff2 丢弃)。head.checkSumAdjustment 保持 0 占位(resolveTTF
已置 0),浏览器渲染不依赖该字段。

ttf 直出(消费 directory checksum)与 woff(ttf2woff 读 directory checksum
写 WOFF 表目录)分支不受影响,仅 woff2 生效。

基准测试全 SSIM 与历史固有值一致(FiraCode 0.9923/初夏纯标点 0.9920/篆体
0.9876 等),woff2 输出字节 IDENTICAL(思源千字文中段 17052/FiraCode 8892/
霞鹜 3840/初夏 6164/6864/得意黑 2532/1628)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 08:02:11 +08:00
..
2026-04-11 17:53:57 +08:00
2026-04-11 17:53:57 +08:00