zellij: Slow down on opening

Hi,

Since version 0.31.0, I have a performance issue when I start zellij. I’m using zellij with Tilix and zsh.

When I open a new terminal using my shortcut : <Super> + <Enter>, if I spam my keyboard 3x on letter A, only one or two letters appears. It gives the impression that the focus is not on the window yet, for 1 second or a little bit more.

I noticed that this “regression” appeared with the 0.31.0 release and was not present before.

I tried using bash + Tilix, zsh + Tilix, zsh + Gnome Terminal, bash + Gnome Terminal : same behavior.

Basic information

zellij --version: zellij 0.31.4 stty size: 44 183 uname -av: Linux LIN-ELN 5.19.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Tue Aug 2 07:35:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

You’ll find log in attachement. I hope I can help for debug or tests.

Regards,

zellij.log

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 2
  • Comments: 16 (6 by maintainers)

Most upvoted comments

I have a similar issue and I have found the cause of it. In my case, lots of exited but eligible for resurrection sessions caused the slowdown. I have noticed list-sessions subcommand take a lot of time to execute. It listed 365 entries. All the listed sessions, apart from the current one, were exited, but eligible for resurrection. Running zellij delete-all-sessions reduced the start-up time enough, so I do not consider it an issue. Now, it is similar to the one before I noticed the problem.

I suppose it is necessary to read sessions at startup, but is it necessary to do it for the exited sessions? If it is, then it would be nice to have a configuration option limiting the number of serialized sessions. I have only found the option for controlling the number of scroll back lines serialized.

For now, setting session_serialization to false alleviates the issue, but at the cost of the resurrection functionality.

I am surprised that I haven’t noticed a gradual build up in the start-up time, but it appeared that after some update the start-up time increased at least 1 second. Perhaps there is some limiting value for the number of sessions that causes a significant slowdown, or, indeed, some change introduced a regression in session listing time. I cannot tell if I experienced the problem after some update or not.

Ideally to also visually indicate this to the user: Querying Terminal for Pixel / Color info… or some such.

It’s weird, I don’t care much about opening slow down, but does Zellij have the option to hide those messages from startup? Or can we cache the result? Those settings are rarely changed and waste ~1 second every time stating the app makes Zellij feel much slower.

Yeah, it appears zellij pauses for 1+ seconds before accepting keyboard input. This frequently causes me to lose several keystrokes.

It would be nice to configure zellij to keep only X number of sessions there and clean things up from time to time (asynchronously, of course).

You should probably create a separate feature request for that, I think (if it doesn’t exist yet). It’s a good one. Or remove if the cache goes over some threshold size (e.g., 100 MiB), or remove sessions older than <date>.

Is it possible to accept STDIN from the user while this is happening, even if you can’t respond until it’s finished? That could simply be replayed to the terminal once it’s available.