zellij icon indicating copy to clipboard operation
zellij copied to clipboard

Lag on input (severe with a held key)

Open patrick-kidger opened this issue 2 years ago • 11 comments

I recently discovered Zellij and it seems pretty cool!

However, I've come across poor performance in one particular case. I'm connecting to a remote Linux machine over SSH; Zellij is installed on the remote machine; the local machine is using Chrome Secure Shell.

In this case, I'm getting pretty bad input lag. After typing a single key it only appears after about (eyeball'd guesstimate) 200ms. When holding down a key, the stream of inputs seems to back up. For example I might hold the enter key (on the terminal) for 5 seconds, release it, and then have the window continue scrolling for another 5 seconds before stopping. This behaviour is common across programs (fish, nvim, etc.)

What's pretty weird is that I'm only getting this issue in this one scenario. Using Zellij with a different terminal is fine. (Which is why I mention the choice of terminal above.) Using Zellij locally is fine. The SSH connection is also fine: when using no multiplexer, or using tmux, there is no lag at all.

Info

Unfortunately I can't attach any output from a corporate machine. :/

Further information

This is Zellij version 0.30.0, installed via cargo install zellij.

I appreciate this report may be borderline-unreproducible on your end! If you've seen anything like this before I'd be happy to try a few possible fixes and see if anything sticks. Other than that, I just thought I'd make you aware of this issue.

patrick-kidger avatar Jul 03 '22 22:07 patrick-kidger

Hi, thanks for reaching out! You could try to get some CPU / system load readings to see if some processes involved (zellij server, zellij client, ssh, chrome native shell) show something suspicious.

The tmux comparison is using the same terminal implementation?

raphCode avatar Jul 05 '22 16:07 raphCode

Nothing seems suspicious unfortunately; the CPU isn't being overloaded etc.

Yes, the tmux comparison is using the same terminal implementation.

patrick-kidger avatar Jul 05 '22 18:07 patrick-kidger

I'm a bit out of luck then, but I remember similar reports of low performance in some niche setups.

You could try to throw a sampling profiler at the zellij processes to see where the time is spend. I am new to profiling, so I don't know if that works properly, since we use a lot of threads.

raphCode avatar Jul 06 '22 12:07 raphCode

Here I collected some info on how to do some profiling, maybe you can give it a try? https://github.com/zellij-org/zellij/issues/296#issuecomment-1181778239

raphCode avatar Jul 12 '22 13:07 raphCode

I have the same issue. I can reproduce it when:

  1. As an SSH client under a headless crouton in the Chrome Shell.
  2. As an SSH client under crostini.
  3. As an SSH client under the above-mentioned Chrome Secure Shell extension.

It is noteworthy that I can not reproduce this issue inside that same crouton when it uses its own graphical environment. Therefore, the issue is somehow specific either to Chrome Shell or ChromeOS.

I don't have the time to run the profiler right now @raphCode, but I'll try to do it within the next day or two. I also want to test whether running Zellij locally will result in the same issues, and I'll attach a GIF to demonstrate the issue if I can.

dzerus3 avatar Jul 22 '22 01:07 dzerus3

The slowdown is there when running Zellij locally as well as remotely, though it is less noticeable. Therefore the issue is not with SSH specifically, but with whatever terminal emulator Chrome seems to be using.

I haven't yet tested whether this bug exists when running the extension in Chrome not on Chrome OS and have not run the profiler, but I have recorded a video which demonstrates the issue.

screen-capture.webm

Please, ignore my fortunes.

dzerus3 avatar Jul 22 '22 03:07 dzerus3

Interesting information, I will try to investigate.

raphCode avatar Jul 26 '22 15:07 raphCode

Original plan was to run the benchmark "within the next day or two," but I cannot successfully get it to compile on my device. Afraid I have to retract that promise for now, sorry.

dzerus3 avatar Jul 31 '22 00:07 dzerus3

@dzerus3, If you are using cargo install, did you try installing it with the information in the readme?

cargo install --locked zellij

a-kenji avatar Jul 31 '22 07:07 a-kenji

@dzerus3,

If you are using cargo install, did you try installing it with the information in the readme?

Yeah, the issue is that whatever repositories my device uses do not include a recent version of Cargo, and it fails to compile because of that every time I try.

I will try again later, but as it is now I use it only for SSH and it's not the most urgent of issues for me.

I have yet to test it using a version Chromium on a different device though. I'll try and do that for now.

dzerus3 avatar Jul 31 '22 15:07 dzerus3

I have yet to test it using a version Chromium on a different device though. I'll try and do that for now.

Chromium extension for me fails to load because Loading pnacl program.... Judging from a another issue report here, I'm not the only one who's encountered that issue.

Sorry everyone, I think the powers that be have conspired to prevent me from testing this out any further 😁

dzerus3 avatar Aug 07 '22 17:08 dzerus3