Skip to content

Instantly share code, notes, and snippets.

@dhruvasagar
Last active April 14, 2019 03:48
Show Gist options
  • Save dhruvasagar/d674f35dd4802a98f896267ccd90ac60 to your computer and use it in GitHub Desktop.
Save dhruvasagar/d674f35dd4802a98f896267ccd90ac60 to your computer and use it in GitHub Desktop.
Simple trick to profile ZSH
if [[ "$ZPROF" = true ]]; then
zmodload zsh/zprof
fi
# ... your ZSHRC with all your scripts
if [[ "$ZPROF" = true ]]; then
zprof
fi
profzsh() {
shell=${1-$SHELL}
ZPROF=true $shell -i -c exit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment