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

/mentions + /grep preview causes severe responsiveness degradation #113

Open
TheDaemoness opened this issue Sep 25, 2023 · 1 comment
Open

Comments

@TheDaemoness
Copy link
Collaborator

/mentions shows a view with all messages containing highlights across all your channels. /grep changes this view to allow you to search through all your windows for messages matching some regex. This is an expensive operation which is performed every time the input bar is updated, including updates that do not change the contents of the input bar (e.g. moving the cursor). After the regex gets longer than a few characters, it can take glirc > 1s on my system to respond to input after allowing it to collect backlog for a few days.

I suggest moving the /mentions + /grep interaction to some other view that doesn't have to deal with redoing the search for previews (/find ?). /grep could then be used to search those views as a form of search refinement.

It may also be worth looking into not triggering a re-render of the view on the aforementioned input bar updates.

@glguy
Copy link
Owner

glguy commented Sep 26, 2023

I suspect what's happening is you have some status message buffer with some 10s of thousands of messages in it. The /mentions view tries to merge lines by timestamp. Until it fills the window it'll search the full history of a window.

One thing we could do is to cache the result of the regular expression match when the expression is the same. The other would be to limit how far back we were willing to search in any one window in that view.

The live view could have an earlier cutoff on how much history it was willing to search.

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

No branches or pull requests

2 participants