spellchecker icon indicating copy to clipboard operation
spellchecker copied to clipboard

Scrolling is slow when many words are underlined in Chromium

Open krassowski opened this issue 1 year ago • 0 comments

Description

The wavy-underline setting uses text-decoration which is expensive to render. In a lorem ipsum with 150 paragraphs (13 227 words), most of which get highlighted this can lead to a visible lag when scrolling with wavy-underline enabled (it currently is opt-in).

Reproduce

  1. Generate 150 paragraphs with https://www.lipsum.com/
  2. Paste it into a file
  3. Use the default background-box theme
  4. Scroll in the file, see it works smoothly
  5. Switch theme to wavy-underline
  6. See that scrolling is laggy

Expected behavior

Scrolling is smooth.

The native underline is expensive because it tries to pack the waves nicely to match word boundaries and support different styles. We could explore:

  • rendering wavy underline using SVG or png background rather than the expensive underline wavelets
  • fixing the performance upstream in Chromium

Context

This is seen in all versions of extension (0.7.x and 0.8.2) regardless of JupyterLab and CodeMirror version.

krassowski avatar Jul 05 '23 10:07 krassowski