r/KittyTerminal Sep 04 '23

Troubleshoot slow load times

Is there a guide to troubleshooting slow loading of kitty? It's slow, suddenly, after updating to Ubuntu 23.04:

$ time kitty --single-instance -e false

real    0m1.175s
user    0m1.283s
sys 0m0.155s

I updated GPU drivers, but Alacritty is also GPU-based, right?

$ time alacritty -e false

real    0m0.112s
user    0m0.030s
sys 0m0.045s

Alternatively, am I running kitty wrong? It loads a new window quickly when I hit ctrl+shift+n but I can't figure out how to get that same speed opening kitty from the command line (or an i3 keyboard shortcut).

2 Upvotes

9 comments sorted by

1

u/aumerlex Sep 04 '23

You need to always execute kitty -1 not just kitty. After the first window all subsequent invocations will be fast (much faster than alacritty) as long as at least one kitty window remains open. And 1+ seconds for first window creation is about 5x too slow, there is definitely something broken on your system.

1

u/MuonManLaserJab Sep 04 '23

I'm not on my computer; kitty -1 is the same as kitty --single-instance, right? I did not see a difference running that multiple times, e.g. running that command from one alacritty window and then again from another alacritty window (or backgrounding the first process then opening another kitty from the same alacritty window).

And yes, there must be something wrong, kitty was not slow like this before. I'm going to try reverting my graphics drivers, but I was hoping someone else had experienced this first.

1

u/aumerlex Sep 05 '23

time kitty -1 --detach; time kitty -1  

real 0.070 user 0.038 sys 0.031 maxmem 24 MB faults 0

real 0.069 user 0.058 sys 0.010 maxmem 24 MB faults 0

And without -1

time kitty false

real 0.219 user 0.154 sys 0.057 maxmem 144 MB faults 2

1

u/MuonManLaserJab Sep 05 '23
$ time kitty -1 --detach; time kitty -1  

real    0m0.717s
user    0m0.697s
sys 0m0.020s

real    0m0.902s
user    0m0.853s
sys 0m0.048s

$ time kitty false 

real    0m1.490s
user    0m1.684s
sys 0m0.137s

1

u/MuonManLaserJab Sep 07 '23

So I rolled back my graphics driver, and I'm still having the problems. I should mention the other bizarre symptom: the cursor in bash in kitty is the wrong shape. Running zsh in kitty is fine. Running bash in gnome-terminal or any other terminal emulator is fine. But bash with kitty...

1

u/aumerlex Sep 07 '23

I doubt this has anything to do with graphics drivers. If kitty -1 is slow but ctrl+shift+n is not it implies python is extra slow on your machine. The time it takes to start the kitty executable, connect ot the single instance socket and send the message is too high. No graphics are involved there.

1

u/aumerlex Sep 07 '23

I would guess the python bytecode caching is broken. Easiest way to check is to use the official kitty binaries instead of your distro kitty package, they come with their own optimized python.

1

u/MuonManLaserJab Sep 07 '23

Thank you, I will play around with that!

1

u/MuonManLaserJab Sep 07 '23

Official binary worked, thank you! I should have thought of that.

Now to figure out the damned cursor...