崮生(子虚) 01b7ee432d perf(ot-bytes): toUint8Array 返回 subarray view 省去 size 字节 memcpy
原 new Uint8Array(buf.subarray(0,size)) 会把已写入字节再拷贝到新 buffer,
而所有调用方(serializeScriptList/FeatureList、subsetGPOS/GSUB 主 writer、
pairSet writer)都是只读消费(writeBytes.set / 存数组后读),toUint8Array 后
writer 不再写入,故直接返回 subarray view(零拷贝共享 buf)完全等价。

24 产物(12 字体 × ttf/woff2)A/B 逐字节 IDENTICAL。
性能 best-of N=3000:霞鹜文楷 p10 -3.2%、初夏明朝 p10 -3.0%、思源OTF p10 -1.6%、
千字文持平(小子集 list/subtable 多、toUint8Array 调用频繁场景收益明显)。
基准测试全 SSIM 通过。

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