-
-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: batch tmux show-options #240
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
I have been using this PR for 2 weeks now and everything seems to work. Would love to have the performance increases/decreases from other people/platforms so we can make a better decision on including this or not. The bash script below will 'benchmark' this PR and the main branch using hyperfine if installed (more accurate/useful data) and #!/usr/bin/env bash
# Clone both repositories/branches
git clone --depth=1 https://github.com/catppuccin/tmux.git catppuccin-tmux
git clone --depth=1 --branch perf/batch-tmux-show https://github.com/vdbe/catppuccin-tmux.git catppuccin-tmux-batch
# Print bash and tmux version
echo "bash: ${BASH_VERSION}"
echo "tmux: $(tmux -V)"
# Benchmark
if command -v hyperfine
then
# hyperfine is installed
hyperfine --warmup 3 -N ./catppuccin-tmux/catppuccin.tmux ./catppuccin-tmux-batch/catppuccin.tmux
else
# hyperfine is not installed just using sleep
echo ./catppuccin-tmux/catppuccin.tmux
time ./catppuccin-tmux/catppuccin.tmux
echo ./catppuccin-tmux-batch/catppuccin.tmux
time ./catppuccin-tmux-batch/catppuccin.tmux
fi Example outputs
|
On macOS:
|
6dded9a
to
f12ba99
Compare
f12ba99
to
f4ed7a1
Compare
f4ed7a1
to
e81518a
Compare
Changes the line separator used by tmux_batch from ':' to the ascii unit separator FIXES: catppuccin#240
Changes the line separator used by tmux_batch from ':' to the ascii unit separator FIXES: catppuccin#240
Changes the line separator used by tmux_batch from ':' to the ascii unit separator FIXES: catppuccin#240
* feat: batch tmux show options * dont check for duplicates * fix: status modules * batch and cache build_window_icon * perf: batch new options * chore: tmux_batch_setup_module -> tmux_batch_setup_status_module * fixup! perf: batch tmux show-options (#240) Changes the line separator used by tmux_batch from ':' to the ascii unit separator FIXES: #240 * fix: string escaping of `..._tmux_batch_...` `tmux show -v <option>` returns/prints the escaped value while the value string of `tmux show <option>` is not escaped. FIXES: #281
Batching tmux show-options gives a significant start uptime decrease of up to 3 under linux (tested with bath bash-5.2.26 and 3.2.57).
On the bash version used by macos this however seems to have a negative impact. This was test in docker with as imagebash:3.2.57-alpine3.19
. The negative impact maybe from docker/alpine since inbash:5.1-alpine3.19
it also had a negative impact but less.Can anyone on macos see what the real effect is?
I think the the complexity increase is worth it if the "macos"/old bash/alpine hit is because of alpine, but would love to get more feedback on this.Effect was docker/alpine build bash-3.2.57 and it works great.
Tested on 10 user configs (from issues) with and without batching and batching was always an improvement.
With defaults in the array is most of the time slower but did not spend any time in looking for improvements since the with defaults is a bit more user friendly.
Example config 1
Example config 2
Example config 3
BEGIN_COMMIT_OVERRIDE
perf: batch tmux show-options
END_COMMIT_OVERRIDE