框架测试:VDOM vs Vapor

产品级矩阵(storms、FCP)见 统一基准矩阵。 本页是 Vue 框架切片——instrumented BG/e2e、流量、包体——外加可交互 playground。ReactLynx 是参考系,不是被测主体。

同一 Vue 应用、两种模式、完整双线程管线 (Vue core benchmark 移植到 Lynx)。Select = 点状更新Update = 批量更新

亲手试

点按 harness 所点的按钮。徽标 = tap → DOM settled。 对比 Vue Vapor / Vue VDOMReactLynx (memo) 放在这里只作量级 参考——不是 ReactLynx 产品基准(那在统一矩阵)。

tap a button to measure
Loading Lynx runtime…

建议: Create 10k → Select storm(点状)→ Update storm(批量)。

Instrumented BG / e2e

操作类型vdom bgvapor bgbgvdom e2evapor e2ee2e
选中行点状2.95 ms0.30 ms9.8×3.45 ms0.55 ms6.3×
每第 10 行更新批量3.20 ms0.55 ms5.8×4.85 ms2.30 ms2.1×
交换行近点状3.90 ms0.65 ms6.0×4.65 ms1.20 ms3.9×
删除行点状2.85 ms0.40 ms7.1×3.40 ms0.90 ms3.8×

e2e < bg,因为两种模式发出的 ops 几乎相同——差距在后台线程的 Vue 工作 (与你的应用逻辑共享)。

创建 e2e 大致持平(vapor create1k ~0.87× … create10k ~0.94×)。见 vapor modeREGISTER_TREE / CLONE_TREE

跨线程流量(create 1k)

vdomvapor
每次 flush ops17,0007,000(−59%)
JSON 字节327 KB160 KB(−51%)

在 Lynx for Web 上几乎不挪动 e2e(DOM 构建占主导)。在 native 上载荷要过 序列化边界——砍半更有意义。

启动、内存、包体

指标vdomvapor备注
首屏(attach → 内容)121.7 ms125.8 ms+3%,CI 重叠
包体 gzip(main.lynx.bundle39.2 KB49.3 KB+26%
10k 行后 JS heap76–136 MB76–105 MB仅供参考

复现

pnpm --filter vue-lynx-benchmark bench          # instrumented
pnpm --filter vue-lynx-benchmark bench:cross    # 黑盒(含 React 参考)
pnpm --filter vue-lynx-benchmark bench:storms

原始数据:packages/benchmark/results/