perf(next): avoid idle observation recomputation

TE
4d ago
+58-3

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:

metricbeforeafterdeltaharness
wallpaper page-row projections across 100 repeated reads1001-99%wallpaperPageRowsAreMemoizedUntilTheCatalogChanges
restored New Tab topology walks after the first cached read across repeated row observations1000-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

metricbeforeafterdeltaharness
wallpaper page-row projections across 100 repeated reads1001−99%wallpaperPageRowsAreMemoizedUntilTheCatalogChanges
restored New Tab topology walks after the first cached read across repeated row observations1000−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.