Skip to content

Instantly share code, notes, and snippets.

@look4regev
Created June 11, 2019 09:22
Show Gist options
  • Save look4regev/089dca96d657181506647f30b1a43d68 to your computer and use it in GitHub Desktop.
Save look4regev/089dca96d657181506647f30b1a43d68 to your computer and use it in GitHub Desktop.
Profiler to find the slowest commands happening on shell startup with zsh
brew install moreutils
cd ~
zsh -xv 2>&1 | ts -i "%.s" > zsh_startup.log
sort --field-separator=' ' -r -k1 zsh_startup.log> sorted.log
# Start a new shell
head sorted.log # Will show slowest operation first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment