崮生(子虚) eb3ed06d41 perf(glyf): simple 字形 fast-path glyfObj 改对象字面量消除隐藏类迁移
glyf.read 的 simple 字形快路径原用 `var glyfObj = {}` 后逐个赋值 9 个属性
(xMin/yMin/xMax/yMax/_origBuf/_origOff/_origLen/_numContours/_totalPoints),
每个字形产生 9 次隐藏类迁移。改为对象字面量一次性创建所有属性,V8 分配稳定隐藏类
(无迁移),且 numberOfContours>0 / =0 统一形状(_numContours 直接用值,
_totalPoints 用三元表达式)。

千字文(129 simple 字形)Font.create best-of p50 约 -3%(多轮 0.1527→0.1479)。
5 字体 woff2 sha 逐字节一致,SSIM 全部不变(仅对象创建方式变化,属性集完全相同)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 20:44:55 +08:00
..