Settings

Theme

Show HN: I measured my tmux statusbar at 15% of a core and replaced the forks

yogesh.lonkar.org

3 points by yogeshlor · 1 comment · 1 min read

Reader

tmux status-interval 1 had six #() programs for statusbar, on battery that was 15.4% of a core.

After digging found fork+exec through sh -c is ~14.6 ms and computing the actual segments was 2.6 ms on my device.

Plus had ~1.5k lines of zsh scripts.

Now one deamon process, caches in memory, unix socket and one #() for the whole right side. From 153.77 ms/s → 18.43 ms/s.

Made that into a tmux plugin. You can try it without installing/configuring:

docker run --rm -it lonkarorg/tmux-companion:playground

1 thread
yogeshlorOP

Recording of the tmux-companion: https://asciinema.org/a/1266213

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection