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

Many enabled highlighters make scrolling and cursor moving very slow and laggy #534

Open
PetbkA opened this issue Jan 24, 2023 · 6 comments
Labels
status: ready for testing resolved but needs testing type: bug
Milestone

Comments

@PetbkA
Copy link

PetbkA commented Jan 24, 2023

OS: Windows 10 LTSC 2021 (version 21H2) x64
Klogg: 22.06.0.1289 Qt5

Here's the example of scrolling - I'm turning mouse wheel constantly but view is srolling as if I'm doing it once in a second.

Same with cursor moving, selection and Page Up / Page Down - when I'm pressing the key, klogg reacts only after 0,5-1 second.

It seems that the problem depends on log frame height, i.e. search results are being scrolled pretty fast 'cause their frame is usually short

@PetbkA
Copy link
Author

PetbkA commented Apr 18, 2023

The same version works OK on MacOS, so the problem is OS-related.

Kind of workaround - reduce the amount of lines in frame by:

  1. Increasing font size;
  2. Expanding the search results frame. Unfortunately this is almost not an option 'cause frame height is returning to default on every file opening (someone even had an issue about it, can't find now :( )

@variar variar added this to the 2022.next milestone Apr 21, 2023
@variar
Copy link
Owner

variar commented Apr 21, 2023

That looks very strange. Could you check if by any chance debug logs are enabled in settings? Also is it the same when using light theme?

@PetbkA
Copy link
Author

PetbkA commented Apr 22, 2023

@variar , suddenly I realized that my highlighter sets are the reason - I have many of them:

sets\size=21
sets\1\HighlighterSet\highlighters\size=4
sets\2\HighlighterSet\highlighters\size=2
sets\3\HighlighterSet\highlighters\size=30
sets\4\HighlighterSet\highlighters\size=24
sets\5\HighlighterSet\highlighters\size=14
sets\6\HighlighterSet\highlighters\size=3
sets\7\HighlighterSet\highlighters\size=6
sets\8\HighlighterSet\highlighters\size=5
sets\9\HighlighterSet\highlighters\size=16
sets\10\HighlighterSet\highlighters\size=25
sets\11\HighlighterSet\highlighters\size=9
sets\12\HighlighterSet\highlighters\size=7
sets\13\HighlighterSet\highlighters\size=5
sets\14\HighlighterSet\highlighters\size=2
sets\15\HighlighterSet\highlighters\size=12
sets\16\HighlighterSet\highlighters\size=3
sets\17\HighlighterSet\highlighters\size=13
sets\18\HighlighterSet\highlighters\size=8
sets\19\HighlighterSet\highlighters\size=4
sets\20\HighlighterSet\highlighters\size=1
sets\21\HighlighterSet\highlighters\size=4

and most of them have been enabled. Disabling some sets is solving the problem.

As for MacOS version - I guess it's just working faster :)

@variar
Copy link
Owner

variar commented Apr 22, 2023

Thanks! That explains why scrolling gets slower with more visible lines. One more reason to switch highlighters to hyperscan. It allows to check a string against a set of regex in one go.

@variar variar changed the title Scrolling and cursor moving are very slow and laggy Many enabled highlighters make scrolling and cursor moving very slow and laggy Apr 22, 2023
@variar
Copy link
Owner

variar commented Nov 18, 2024

I've added hyperscan support for highlighters. It works as a pre-filter to skip highlighters that definetely can't match a line (hyperscan support for reporting exact match position is limited). All highlighters that do pass this pre-filter step are checked as normal to get exact matches. This should improve things when most highlighters don't match. Integrated into 24.11.0.1662.

@variar variar added the status: ready for testing resolved but needs testing label Nov 18, 2024
@variar
Copy link
Owner

variar commented Nov 24, 2024

I've accidentaly disabled hyperscan in all builds. Fixed in 24.11.0.1681. Now pre-filtering using hyperscan quick matching should be fast again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready for testing resolved but needs testing type: bug
Projects
None yet
Development

No branches or pull requests

2 participants