Predelnik / DSpellCheck

Notepad++ Spell-checking Plug-in
GNU General Public License v2.0
199 stars 34 forks source link

Laggy scrolling when underlining enabled #195

Open ryancu7 opened 5 years ago

ryancu7 commented 5 years ago
  1. Make sure Plugins > DSpellCheck > Spell Check Document Automatically is turned on
  2. Scroll up or down a text file that has a large number of spelling errors. (It is most noticeably when scrolling with the mouse wheel.)

The display when scrolling is jerky, some parts of the document more than others. To me, this FPS delay this causes is unacceptable and I cannot use the underline-as-you-type feature :(

Predelnik commented 5 years ago

I agree that having large number of words underlined on the screen slows things down however it might not be due to the plugin only unfortunately. There is 3 components to this:

  1. Spell-checking, which should not be affected much by how many words are misspelled so it most likely should not be the cause of a slow-down
  2. Sending messages to API to underline words, some of which may already be underlined which can be source of inefficiency.
  3. Drawing these underlines by Notepad++/Scintilla. (Mostly out of my control)

Initially I thought that number 2 was to blame but it looks like even without frequent updates drawing huge amount of underlines on screen by Notepad++ seems to be visibly slow. I would like to try to optimize 1 and 2 to lower the amount of text being rechecked but unfortunately it would take quite some effort and may become source of new bugs, also it's still unclear if gain would be noticeable.

To address this issue I probably need to profile all Notepad++/scintilla/DSpellCheck with debug info to get more precise picture than I currently have.

TLDR: I understand the issue but fixing it in immediate future might not be easy.

ryancu7 commented 5 years ago

Would it be possible to disable the underlining during scrolling and then as soon as scrolling stops to redraw one more time to have it show again? Either way, profiling sounds like a great idea.

Predelnik commented 4 years ago

I have written a bit about this issue and performance in general on wiki: https://github.com/Predelnik/DSpellCheck/wiki/Perfomance_1_4_15

J-G-Froejk commented 4 years ago

Just a note, to other users coming here, because they experience this issue. I also have felt this laggy keyboard (on huge files) since upgraded NPP to 7.8.x (all versions) I final was annoyed enough to look for a solution. DSpellCheck is on 1.4.15, but it was still an issue.

Lucky it went away after I go into DSpellCheck settings, click something, press apply, then click it on again and another apply. So it looks like a resave of DSpellCheck settings helped me.

I never do clean install. So it is a 2-3 year old updated/upgraded NPP install.

Predelnik commented 4 years ago

@J-G-Froejk Well that's pretty strange rewriting settings should not change anything, restarting application may have an effect after updating plugin or something to reload it though.

Anyway this issue is not about changes in 7.8 but about slow behavior in general when there is many underlines which is hopefully not very frequent situation and mostly means that e.g. incorrect language was selected for spell checking.