一句话:提出 Spineless Traversal,一种缓存友好的增量布局算法,避免访问辅助节点,显著降低布局延迟。
网页渲染引擎依赖增量布局降低交互延迟:仅标记并重绘帧间变化的脏元素。然而标准算法需在页面中搜索脏元素,途中访问辅助节点,造成缓存缺失和停顿,占布局延迟很大比例。本文提出 Spineless Traversal,一种更快的增量布局算法。它采用对缓存更友好的优先队列遍历,避免访问辅助节点,从而减少缓存流量与停顿。结合多项底层优化,该方法在各类增量布局负载上均有竞争力。在 2216 个基准中,Spineless Traversal 在 83.0% 上快于标准方法,平均加速 1.80×,且加速集中在悬停、输入和动画等延迟关键交互。
Latency is a major concern for web rendering engines like those in Chrome, Safari, and Firefox. These engines reduce latency by using an incremental layout algorithm to redraw the page when the user interacts with it. In such an algorithm, elements that change frame-to-frame are marked dirty, and only those elements are processed to draw the next frame, dramatically reducing latency. However, the standard incremental layout algorithm must search the page for dirty elements, accessing auxiliary elements in the process. These auxiliary elements add cache misses and stalled cycles, and are responsible for a sizable fraction of all layout latency. We introduce a new, faster incremental layout algorithm called Spineless Traversal. Spineless Traversal uses a cache-friendlier priority queue algorithm that avoids accessing auxiliary nodes and thus reduces cache traffic and stalls. This leads to dramatic speedups on the most latency-critical interactions such as hovering, typing, and animation. Moreover, thanks to numerous low-level optimizations, Spineless Traversal is competitive across the whole spectrum of incremental layout workloads. Spineless Traversal is faster than the standard approach on 83.0% of 2216 benchmarks, with a mean speedup of 1.80× concentrated in the most latency-critical interactions.
@article{paperbot3115,
title = {Spineless Traversal for Layout Invalidation},
author = {Marisa Kirisame and Tiezhi Wang and Pavel Panchekha},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {PLDI},
year = {2025},
doi = {10.1145/3729322}
}