zsh-users
 help / color / mirror / code / Atom feed
From: "Benjamin R. Haskell" <zsh@benizi.com>
To: "Daniel Serodio (lists)" <daniel.lists@mandic.com.br>
Cc: zsh-users@zsh.org
Subject: Re: "Profiling" my startup scripts
Date: Wed, 23 Nov 2011 17:04:57 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.01.1111231657230.14380@hp.internal> (raw)
In-Reply-To: <4ECD5FC4.2000809@mandic.com.br>

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


      parent reply	other threads:[~2011-11-23 22:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 21:04 Daniel Serodio (lists)
2011-11-23 21:20 ` Mikael Magnusson
2011-11-23 21:25 ` Dan Nelson
2011-11-23 22:04 ` Benjamin R. Haskell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.01.1111231657230.14380@hp.internal \
    --to=zsh@benizi.com \
    --cc=daniel.lists@mandic.com.br \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).