Skip to content

Profile-guided performance optimization for scrolling - #284

Merged
texodus merged 1 commit into
masterfrom
perf-a
Aug 11, 2026
Merged

Profile-guided performance optimization for scrolling#284
texodus merged 1 commit into
masterfrom
perf-a

Conversation

@texodus

@texodus texodus commented Aug 11, 2026

Copy link
Copy Markdown
Member

This PR addresses Chrome-specific (though broadly applicable) performance/DOM/layout optimization, based on Chrome profiler output, specifically targetting scroll performance in Perspective (which has complex colspan and rowspan layout invalidations).

  • Replaces continuous measure+apply column autosizing with ResizeObserver based sizing on the header only, which dramatically reduces forced relayouts reading offsetWidth.
  • Memoize header cells (like body cells have always done).
  • Use the predraw implementation previously added to render scroll frames also (using requestAnimationFrame to flush synchronously).
  • Opt-in column_classes API so Perspective need not set style or class on all cells.
  • Coalesce scroll events. I don't know if anyone uses these, but Perspective does not and they are profiler noise.

My totally non-scientific benchmark shows a 10ms ~> 2ms (per frame) improvement in non-JavaScript render time during scroll for a complex Perspective test case.

@texodus texodus added enhancement Feature requests or improvements breaking labels Aug 11, 2026
@texodus
texodus merged commit 5172e84 into master Aug 11, 2026
2 checks passed
@texodus
texodus deleted the perf-a branch August 11, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking enhancement Feature requests or improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant