Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "Profiling" my startup scripts



On Wed, 23 Nov 2011, Daniel Serodio (lists) wrote:

I have somewhat complex .zshrc and .zshenv startup scripts that I've improved over the years, running Linux. Now I'm using OSX and something in these scripts is taking more time than usual, and I'd like to "profile" them, ie. find out how long each step takes.

My first idea was to add a $(date) execution to PS4, but I found that it doesn't work in zsh (it works in bash).

Do you have any suggestions about a better way to profile my startup scripts?

If you're looking for differences that could be spotted by $(date) (so, things that take multiple seconds to run), you might try just running with tracing enabled:

zsh -x

The commands are output before they're run, so if you end up with:

+.zshrc:123> some long running command

You can probably just eyeball it.

--
Best,
Ben



Messages sorted by: Reverse Date, Date, Thread, Author