The Real Fullstack

The Frozen Interface

The code uses async and signals everywhere. So why can't the user even scroll while the report updates?

工程师8 分钟性能实验室时间线模拟器
angularbrowser-apistypescriptweb-workers

此挑战尚未翻译为简体中文,你正在阅读英文版本。

任务:Bring the interaction delay (INP estimate) under 200 ms while results still appear within 1.1 seconds.背景 · 学习目标 ▾

Quillfin's risk report shows 10,000 positions. Every filter change re-sorts and re-formats all rows, then renders the whole table. Users click, nothing happens, they click again — and the page responds to both clicks a second later.

任务: Bring the interaction delay (INP estimate) under 200 ms while results still appear within 1.1 seconds.

学习目标

  • Explain why long tasks block input even in async code.
  • Move or split CPU work: Web Workers and yielding.
  • Reduce DOM work with virtual scrolling.
模拟模拟数据

运行模拟以查看输出。

运行模拟
onFilterChange(filter: Filter) {  // 900 ms of sorting and formatting on the main thread …  const rows = this.allRows.filter((r) => matches(r, filter)).sort(byRisk).map(format);  this.rows.set(rows);   // … then 10,000 table rows rendered at once}

简化说明

One compute task and one render task with fixed costs. Real INP also includes style, layout and paint, and varies by device. 教学模型——数字用于说明行为,并非基准测试。

概念

建议先完成

相关挑战

参考资料