mirror of
https://github.com/2234839/web-font.git
synced 2026-09-12 20:11:51 +08:00
固定点迭代中 collectChainRefs 高频调用(初夏纯标点 840 次/call)。format3 原实现: 读完全部 backtrack/input/lookahead coverage 把 gid 收进 allGids 中间数组,任一不在 子集才置 triggerable=false,且每次调用分配 readCovGids 闭包 + allGids 数组。 优化:遇到不在子集的 gid 立即短路返回(triggerable=false 时 contextGids/refs 本就不 收集,后续 coverage 无需再读);去掉闭包与 allGids,triggerable 时 gid 直接 add 进 contextGids。逻辑完全等价(triggerable=false 时原代码也不 add contextGids)。 基准 29 用例 SSIM/ink/字节全无回归。初夏纯标点 2.34→1.86ms(-20%),FiraCode 3.7→3.4ms。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>