Skip to content

Instantly share code, notes, and snippets.

@romkatv
Last active November 30, 2019 11:04
Show Gist options
  • Save romkatv/d882e2c5abd5b3b05e1d81a28a7fb3aa to your computer and use it in GitHub Desktop.
Save romkatv/d882e2c5abd5b3b05e1d81a28a7fb3aa to your computer and use it in GitHub Desktop.
Measure zsh prompt latency with various themes
# Measure zsh prompt latency with various themes:
#
# 1. Run the docker command.
# 2. Type `ZSH_THEME=XXX exec zsh` where `XXX` is a theme name such as
# `agnoster` or `powerlevel10k/powerlevel10k`.
# 3. Type `zsh-prompt-benchmark` and press and hold ENTER until benchmark
# results appear. It takes about 10 seconds.
docker run -e TERM -it --rm archlinux/base bash -uexc '
pacman -Sy --noconfirm zsh git
git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cd ~/.oh-my-zsh
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git custom/themes/powerlevel10k
git clone --depth=1 https://github.com/romkatv/zsh-prompt-benchmark.git custom/plugins/zsh-prompt-benchmark
echo "
ZSH=~/.oh-my-zsh
: \${ZSH_THEME:=robbyrussell}
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
plugins=(zsh-prompt-benchmark)
source ~/.oh-my-zsh/oh-my-zsh.sh" > ~/.zshrc
exec zsh'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment