spellchecker
spellchecker copied to clipboard
Scrolling is slow when many words are underlined in Chromium
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
- Generate 150 paragraphs with https://www.lipsum.com/
- Paste it into a file
- Use the default
background-box
theme - Scroll in the file, see it works smoothly
- Switch
theme
towavy-underline
- 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.