I've run tmux since somewhere in 2016 because I can script it. Ten years of scripts later my status bar was using 15.4% of a core on battery, so I measured it, cut it to one call, and moved the scripts into one Rust…
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 comment
yogeshlor7 days ago
Recording of the tmux-companion: https://asciinema.org/a/1266213
Read the full thread on Hacker News →
Related stories
- Hacker News · 1 points · 2 days ago
- Hacker News · 421 points · 6 days ago
- Hacker News · 3 points · 3 days ago
- Hacker News · 1 points · 4 days ago
- Hacker News · 1 points · 6 days ago
- Hacker News · 2 points · about 10 hours ago