zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
20.61k stars 638 forks source link

Lag on input (severe with a held key) #1556

Open patrick-kidger opened 2 years ago

patrick-kidger commented 2 years ago

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.

raphCode commented 2 years ago

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?

patrick-kidger commented 2 years ago

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

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

raphCode commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Interesting information, I will try to investigate.

a-kenji commented 2 years ago

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

cargo install --locked zellij