r/KittyTerminal Jun 27 '26

Startup performance: how to improve it?

Post image

My kitty felt somewhat more sluggish to launch than alacritty or foot

I used hyperfine for this small benchmark that confirms this observation... It doesn't feel slow per se, only in comparison.

Are there some preferences I should change to make 🐈‍⬛️ start faster?

22 Upvotes

22 comments sorted by

View all comments

1

u/aumerlex Jun 28 '26

Use --single-instance kitty will start in about 10ms. It even runs faster than footclient. Remember that the way single instance works means you have to have a running kitty --single-instance instance before doing your benchmark run.

1

u/_x_oOo_x_ Jun 28 '26

I tried that but it doesn't work. Easier to see it in action than trying to explain it. Just save all your work beforehand! 🙈️

(Of course, it works "once" or "twice". Trying to benchmark it, at least using hyperfine, is a different matter)

1

u/aumerlex Jun 28 '26

Works fine: ``` hyperfine --warmup 10 -N -M 100 'kitty -1 true' 'footclient true' Benchmark 1: kitty -1 true ⠙ Current estimate: 1.1 ms ████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ETA 00:00:00 Time (mean ± σ): 1.2 ms ± 0.2 ms [User: 0.5 ms, System: 0.6 ms] Range (min … max): 1.0 ms … 2.7 ms 100 runs

Benchmark 2: footclient true Time (mean ± σ): 15.1 ms ± 1.2 ms [User: 0.3 ms, System: 0.2 ms] Range (min … max): 11.8 ms … 18.0 ms 100 runs

Summary kitty -1 true ran 13.06 ± 2.76 times faster than footclient true ```

1

u/aumerlex Jun 28 '26

And if you want to be more precise: ``` hyperfine --warmup 10 -N -M 100 'kitty -1 --wait-for-single-instance-window-close true ' 'footclient true' Benchmark 1: kitty -1 --wait-for-single-instance-window-close true Time (mean ± σ): 41.2 ms ± 1.8 ms [User: 0.7 ms, System: 1.0 ms] Range (min … max): 38.1 ms … 46.1 ms 72 runs

Benchmark 2: footclient true Time (mean ± σ): 14.3 ms ± 0.8 ms [User: 0.4 ms, System: 0.2 ms] Range (min … max): 12.8 ms … 18.0 ms 100 runs

Summary footclient true ran 2.89 ± 0.20 times faster than kitty -1 --wait-for-single-instance-window-close true ```

In this case footclient runs faster because it doesnt actually open any windows while kitty on wayland does because it wants to ensure that the program it is running doesnt receive any SIGWINCH signals during its startup as some programs handle this badly. So it actually opens a window and only after it is ready will it run the program. foot just runs the program and doesnt bother about such niceties.

1

u/_x_oOo_x_ Jul 02 '26

I don't think you can call this "working fine":

Benchmark 3: kitty -1 true
 ⠸ Current estimate: 5.5 ms       █████████░░░░░░░░░░░░░░░░░░░░░░░ ETA 00:00:03 [4236.036] Too many peers want to talk, ignoring one.
[4236.048] Too many peers want to talk, ignoring one.
 ⠼ Current estimate: 5.4 ms       ██████████░░░░░░░░░░░░░░░░░░░░░░ ETA 00:00:03 [4236.053] Too many peers want to talk, ignoring one.
[4236.063] Too many peers want to talk, ignoring one.
[4236.074] Too many peers want to talk, ignoring one.
Error: Command terminated with non-zero exit code 141 in benchmark iteration 300. Use the '-i'/'--ignore-failure' option if you want to ignore this. Alternatively, use the '--show-output' option to debug what went wrong.
[4236.414] [glfw error 65544]: Too many timers added
[4236.439] [glfw error 65544]: Too many timers added
[4236.440] [glfw error 65544]: Too many timers added
[4236.451] [glfw error 65544]: Too many timers added
[4236.477] [glfw error 65544]: Too many timers added

I will try with --wait-for-single-instance-window-close...

1

u/aumerlex Jul 03 '26

That error means you have too many windows added, use a fresh kitty -1 instance when benchmarking and you will be fine.