Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- X-seq: zsh-users 27399
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Cc: Zach Riggle <zachriggle@xxxxxxxxx>, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Date: Tue, 30 Nov 2021 09:29:11 +0100
- Archived-at: <https://zsh.org/users/27399>
- In-reply-to: <CAHYJk3TJFRKD3DjmR895BFKrJB649j6W=_u8_9fBY2ptprF2tQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAMP9c5=AkW8B0byaw9J-_rVJ0B19q9xx3wjz3MAgJr6uCF6vNQ@mail.gmail.com> <CAN=4vMpyybbN-DTT7eAXdxV_a=CtaEcaNTKEszQjgL8urTY_zg@mail.gmail.com> <CAH+w=7ZuG0z7m5_z8qCaGiCpDO0KRvXHWz3jkighvkaFcd6+LA@mail.gmail.com> <CAMP9c5=nQS_cw19fuKhKMJAAVPwEr5oCNUiBDBCWBiPC1KioWw@mail.gmail.com> <CAN=4vMoJZZZCbPK-5Ss=gE7iwieHZ4HFF=H9O0TzgMrGBPio6g@mail.gmail.com> <CAHYJk3TJFRKD3DjmR895BFKrJB649j6W=_u8_9fBY2ptprF2tQ@mail.gmail.com>
On Tue, Nov 30, 2021 at 9:10 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> On 11/30/21, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
> > On Tue, Nov 30, 2021 at 3:30 AM Zach Riggle <zachriggle@xxxxxxxxx> wrote:
> >>
> >> The benchmark I used
> >>
> >> $ hyperfine 'zsh -i -l "exit 0"'
> >>
> >>
> >> Obviously this is not the BEST benchmark [for checking shell startup
> >> time]
> >
> > Obviously. It's the worst or at least a strong contender for the title.
>
> I think it's fine to do this (assuming he actually meant -i -l -c
> "exit 0" (missing -c in the quoted command)), if you don't do any
> weird stuff in your startup files
Indeed, if all of the following conditions are met, the timing of `zsh
-lic exit` is close to zsh startup time:
- No prompt_subst.
- No precmd hooks.
- No zle hooks.
- No exit hooks.
- No HISTFILE.
- No .zlogout.
- No conditioning on ZSH_EXECUTION_STRING.
I don't know if these things are weird but rc files using at least one
of them are common.
> > Since you care about interactive zsh performance, at least skim
> > through the homepage of zsh-bench. It'll save you time.
>
> % ./zsh-bench
> ==> benchmarking login shell of mikaelh ...
> zsh-bench: cannot find prompt; make sure it contains hostname or the
> last part of the current directory
>
> Sadly no time was saved :(.
That's an unorthodox reading of "skim through the homepage".
Roman.
- References:
- Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
Messages sorted by:
Reverse Date,
Date,
Thread,
Author