davidbalbert / Watt

A high performance text editor for macOS.
MIT License
57 stars 2 forks source link

Scrolling hangs with tall windows #84

Open davidbalbert opened 1 year ago

davidbalbert commented 1 year ago
  1. Make the window tall.
  2. Drag the scroller far

Observe the jank.

davidbalbert commented 1 year ago

I will remeasure once I get to this, but it looks like the big offenders are:

For the former, all the time is spent in Spans builder. I wonder if I can get a speed up by inserting a bunch at the same time.

For the latter, maybe I can add an initializer that makes an NSAttributedString directly from an AttributedSubstring.

davidbalbert commented 1 year ago

FWIW, the jank is mostly not present in Release builds, but I still sometimes get to pretty high CPU, and it'd be nice to lower that.