Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions window causes Plover to lag with large scrollback #1477

Closed
Phorofor opened this issue Jan 30, 2022 · 3 comments · Fixed by #1481
Closed

Suggestions window causes Plover to lag with large scrollback #1477

Phorofor opened this issue Jan 30, 2022 · 3 comments · Fixed by #1481

Comments

@Phorofor
Copy link

Describe the bug

Keeping the Plover: Suggestions window open causes Plover to eventually noticeably lag when there's a lot of scroll-back.

This may be related to issue #778 although it seems like a separate issue.

This slows down the performance of Plover with other windows, such as the Paper Tape window having delayed updates, along with words appearing like they are being typed slowly.

To Reproduce

Steps to reproduce the behavior:

  1. If the Plover: Suggestions window is not visible, navigate to the Plover tray/menu bar icon and select Tools > Suggestions.
  2. Keep the Plover: Suggestions open for your entire of session of Plover running.
  3. Wait until the Plover: Suggestions window's vertical scrollbar is approximately 12 logical pixels tall, depending on its window size—keep using Plover with steno inputs until it has a fairly large scroll-back. Usually lag is noticeable as the Suggestions window content builds up after a while.

image

Expected behavior

Plover's performance should remain like it is when the Suggestions window is not very populated without any degraded performance.

Manually clearing the Suggestions window with the 'bin' icon restores Plover's performance, with windows such as the Paper Tape and text appearing instantly as it should.

Screenshots

Not applicable.

Operating system

  • OS: Windows 11 21H2, Build 22000. 376
  • Plover Version: 4.0.0.dev10+120.g4394ef1

Hardware

Not applicable.

@Phorofor Phorofor added the bug label Jan 30, 2022
@Phorofor Phorofor changed the title Suggestions window lags with large scrollback Suggestions window causes Plover to lag with large scrollback Jan 30, 2022
@user202729
Copy link
Member

Not sure if there's anything Plover can do about this. The computer have to do the work and the work takes that much time, the way to avoid taking the time is to make it do less work.

Possible things to look for...

  • is the update code inefficient? (subject to Qt's API limitation)
  • is the GUI thread blocking the main thread? (it shouldn't.)

and

  • should there be some option to automatically clear the older entries when it reaches X entries?

@dnaq
Copy link

dnaq commented Feb 6, 2022

I think there's definitely something accidentally quadratic going on here. The amount of work plover has to do shouldn't have anything to do with the number of suggestions in the window.

The easy short term solution would be to cap the size of the scroll back buffer, but the real solution would be to find the cause of that quadratic behaviour.

@benoit-pierre
Copy link
Member

Every time a new suggestion is added, the QListView ask for each previous suggestion' size... #1481 should speed up things nicely, please test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants