perf(next): avoid idle observation recomputation
The NEXT main thread repeatedly rebuilt two observation-derived structures while idle. Settings host-list reads rebuilt wallpaper page rows and sidebar observations walked every restored tab even when only row status changed. This caches wallpaper page rows until the catalog changes, exposes a tab-topology revision, and reuses restored New Tab IDs until either input changes.
Performance:
| metric | before | after | delta | harness |
|---|---|---|---|---|
| wallpaper page-row projections across 100 repeated reads | 100 | 1 | -99% | wallpaperPageRowsAreMemoizedUntilTheCatalogChanges |
| restored New Tab topology walks after the first cached read across repeated row observations | 100 | 0 | -100% | SidebarBridge.cachedNewTabPages revision/input cache |
The cache stops when the catalog value, tab-list revision, or explicit page IDs change; no timer or observer is introduced.
Cause B from the cpu-audit idle main-thread sample. Compile with cmux-ci compile-check --ref 234b2943003021759e12e7ef917f25b38946d94b --app.
Agent session: agent session
Summary by cubic
The NEXT main thread repeatedly rebuilt two observation-derived structures while idle. Settings host-list reads rebuilt wallpaper page rows, and sidebar observations walked every restored tab even when only row status changed. This change caches wallpaper page rows until the catalog changes, exposes a tab-topology revision, and reuses restored New Tab IDs until either input changes. It addresses cause B from the idle main-thread CPU audit.
Performance
| metric | before | after | delta | harness |
|---|---|---|---|---|
| wallpaper page-row projections across 100 repeated reads | 100 | 1 | −99% | wallpaperPageRowsAreMemoizedUntilTheCatalogChanges |
| restored New Tab topology walks after the first cached read across repeated row observations | 100 | 0 | −100% | SidebarBridge.cachedNewTabPages revision/input cache |
The cache stops when the catalog value, tab-list revision, or explicit page IDs change; no timer or observer is introduced.