-
-
Notifications
You must be signed in to change notification settings - Fork 687
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
[BUG] text selection very slow with large output #877
Comments
Thank you!! I have been trying to reproduce this one for a short while. @tlinford - any ideas? |
no problem 😄 some more notes:
|
Yes, for sure! this is likely a small issue somewhere in us looking through the wrong stuff (just a guess, will need to debug this). |
@imsnif I'm thinking it may not be directly related to mouse mode, running |
I know of this issue with line wrapping. A line with 5 wraps is counted as one line for the scrollback purposes... do you think it's related? Can this be reproduced while filling the scroll buffer with lines no longer than the pane width? |
Looks related indeed, with no line wraps: for i in range(10000):
print("hello") everything smooth. for i in range(10000):
print("hello"*50) slowdown starts to appear, pretty bad with mouse, not very noticeable with scroll mode. for i in range(10000):
print("hello"*1000) everything becomes sluggish. |
I don't think wrapping is the (only) issue. 10000 lines of I think it's just the amount of text. maybe try the same |
PS: while my machine is reasonably beefy, it's just a laptop - so maybe on a sufficiently strong PC the issue only starts being noticeable after wrapping as it will be a lot more text - but for me it reproduces before wrapping. |
no you are right - it seems the wider the line, the slower it gets, thanks for the insight. |
i think i've found what's happening: Did a quick test with some log::infos thrown in to measure how long things are taking (in microseconds):
|
Ahh, nice one! This is done purely for the UI - if you comment out the contents of this function and just return (0, 0) does it fix this? |
yep! |
Good find!! Can you think of a way to either cache these numbers or reduce the complexity (or both)? |
well, first thing that comes to mind is to store the width on the row, and update it when it gets mutated. |
IMO this path might have some friction in it as it might harm the performance of eg. throwing large amounts of data into the scroll buffer. I'd try to maybe cache the result of this whole function on @tlinford - if you have the time and feel like taking this up, that'll be cool. If not I'll try to get to it in the next few days. |
In Case of Graphical or Performance Issues
zellij-debug.tar.gz
Basic information
zellij --version
: 20.1tput lines
: 51tput cols
: 104uname -av
orver
(Windows):List of programs you interact with as,
PROGRAM --version
:happens in both alacritty and gnome-terminal - neither of them has this issue when not using
zellij
alacritty --version
:alacritty 0.9.0
gnome-terminal --version
:# GNOME Terminal 3.36.2 using VTE 0.60.3 +BIDI +GNUTLS +ICU +SYSTEMD
Further information
another quicker way to repro is usually just a simple
rg a
as it's not as slow as generating random data - but that would have included sensitive stuff in the debug logit gets really bad at around 50k lines
The text was updated successfully, but these errors were encountered: