jupyterlab-contrib / spellchecker

Spellchecker for JupyterLab notebook markdown cells and file editor.
BSD 3-Clause "New" or "Revised" License
202 stars 20 forks source link

Scrolling is slow when many words are underlined in Chromium #132

Open krassowski opened 1 year ago

krassowski commented 1 year ago

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:

Context

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