requestIdleCallback vs setTimeout: The Delay I Actually Measured
Описание и применение
<ul> <li><p>On an idle page, requestIdleCallback and setTimeout(0) both fired in under 6ms across every run</p></li> <li><p>Under a simulated 8ms-per-frame render load, requestIdleCallback delay jumped to 13.6-28.8ms</p></li> <li><p>setTimeout(0) stayed under 0.3ms delay in the same busy-page test, every single run</p></li> <li><p>requestIdleCallback is the one that waits, not setTimeout, which is backwards from what most advice assumes</p></li> </ul> <p>I'd always assumed requestIdleCallback was the polite one and setTimeout(0) was the one that could jump the queue if the page got busy. I bui
Задача
<ul> <li><p>On an idle page, requestIdleCallback and setTimeout(0) both fired in under 6ms across every run</p></li> <li><p>Under a simulated 8ms-per-frame render load, requestIdleCallback delay jumped to 13.6-28.8ms</p></li> <li><p>setTimeout(0) stayed under 0.3ms delay in the same busy-page test, every single run</p></li> <li><p>requestIdleCallback is the one that waits, not setTimeout, which is backwards from what most advice assumes</p></li> </ul> <p>I'd always assumed requestIdleCallback was the polite one and setTimeout(0) was the one that could jump the queue if the page got busy. I bui
Результат
<ul> <li><p>On an idle page, requestIdleCallback and setTimeout(0) both fired in under 6ms across every run</p></li> <li><p>Under a simulated 8ms-per-frame render load, requestIdleCallback delay jumped to 13.6-28.8ms</p></li> <li><p>setTimeout(0) stayed under 0.3ms delay in the same busy-page test, every single run</p></li> <li><p>requestIdleCallback is the one that waits, not setTimeout, which is backwards from what most advice assumes</p></li> </ul> <p>I'd always assumed requestIdleCallback was the polite one and setTimeout(0) was the one that could jump the queue if the page got busy. I bui
Доказательства
requestIdleCallback vs setTimeout: The Delay I Actually Measured
- Дата записи: 2026-11-01T22:14:02.049Z