1

I'd like to profile the performance of tmux. In particular how fast starting up a session is (and maybe also attaching to a session). I'm especially interested in how the content of my .tmux.conf file affects startup times (I use plugins).

How could I measure that in an objective way?

As an example of what I'm interested in, I run this to profile the startup times of my zsh setup.

repeat 5 {/usr/bin/time zsh -i -c exit}

I've tried automating things with commands like the one below, but I can't figure out how to get timings. Also, this seems to execute asynchonously, the command finishes before the session is killed.

tmux new-session -d -s test && tmux send-keys "exit" Enter
Klas Mellbourn
  • 387
  • 4
  • 13

1 Answers1

0

You could do something like this for startup time:

date +%T.%N; tmux -Ltest new -d 'date +%T.%N; sleep 10'
tmux -Ltest capturep -p|sed '/^$/d'
tmux -Ltest kill-server

You can also add -vv to tmux and you will get a log file with timestamps, but it will take some interpretation...

Nicholas Marriott
  • 3,630
  • 9
  • 12