Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "Profiling" my startup scripts
- X-seq: zsh-users 16592
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: "Daniel Serodio (lists)" <daniel.lists@xxxxxxxxxxxxx>
- Subject: Re: "Profiling" my startup scripts
- Date: Wed, 23 Nov 2011 22:20:47 +0100
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8Y2/HVS2/FlpMRdH1dJ2Czny5Oe+yWhrqM2EHUUwIKQ=; b=at1FnZ7aXOq5ly1L9dhnhhE5WSY7yp8nhE5ECTxovaDQQYyysWTk9lh4mwhZ4ojlC6 GX0kl+6XKn6mSue9CLQY0AQW5FGt2lRWdyz2MHDH+qRll194v+ljwBGgkYRendaUcanT jq0B5m4vI0OR2TSbNd+AW+PkIHAP4S4BxPfBo=
- In-reply-to: <4ECD5FC4.2000809@mandic.com.br>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <4ECD5FC4.2000809@mandic.com.br>
On 23 November 2011 22:04, Daniel Serodio (lists)
<daniel.lists@xxxxxxxxxxxxx> 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?
>
> Also, would you add this feature (command execution substitution in PS4) to
> zsh?
Running $(date) on every line of your rc is probably a bad idea, but
you can setopt promptsubst to enable it. Rather than running date,
though, it's a much better idea to run typeset -F 3 SECONDS and use
$SECONDS in PS4 (this also needs promptsubst).
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author