zsh-users
 help / color / mirror / code / Atom feed
From: Julien Nicoulaud <julien.nicoulaud@gmail.com>
To: pengyu.ut@gmail.com
Cc: sgniazdowski@gmail.com, Mailing-list zsh-users <zsh-users@zsh.org>
Subject: Re: slow startup of zsh (1x slower than bash)
Date: Fri, 7 Dec 2018 17:13:26 +0100	[thread overview]
Message-ID: <CA+mcLN5dpscPNhpsKoA0j8tvcUh2-A7KOX7wNQYFQ7q3sdg+SA@mail.gmail.com> (raw)
In-Reply-To: <CABrM6w=B8BP6Pk4HsW+XGDv0bpC9fYtNdr80SS6BtqegXJNcUA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3141 bytes --]

I don't think so, zsh is faster than bash for me without rc files:

❯ repeat 5 { time bash --norc --noprofile -c exit }
took 0,011s (100% cpu)
took 0,011s (98% cpu)
took 0,011s (100% cpu)
took 0,011s (100% cpu)
took 0,011s (99% cpu)
❯ repeat 5 { time zsh -fc exit }
took 0,002s (89% cpu)
took 0,001s (90% cpu)
took 0,001s (92% cpu)
took 0,001s (92% cpu)
took 0,001s (91% cpu)

same with rc files:
❯ repeat 5 { time bash -c exit }
took 0,028s (89% cpu)
took 0,022s (100% cpu)
took 0,022s (100% cpu)
took 0,022s (100% cpu)
took 0,023s (99% cpu)
❯ repeat 5 { time zsh -c exit }
took 0,008s (91% cpu)
took 0,008s (92% cpu)
took 0,007s (92% cpu)
took 0,007s (92% cpu)
took 0,005s (91% cpu)

Julien

Le ven. 7 déc. 2018 à 03:57, Peng Yu <pengyu.ut@gmail.com> a écrit :

> On Thu, Dec 6, 2018 at 8:20 PM Sebastian Gniazdowski
> <sgniazdowski@gmail.com> wrote:
> >
> > On Mon, 3 Dec 2018 at 17:28, Peng Yu <pengyu.ut@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > The following example shows that zsh startup time is much slower than
> > > other shells. Can this be improved to at least as fast as bash?
> > >
> >
> > Is it the last zsh version that's being tested? There was 2x startup
> > improvement at 5.4 or something like this.
>
> Here is the version. I have not set up zsh to do anything fancy. I
> guess the slowness of startup is because zsh does too many things
> upfront and has more features than other shells, and the increase in
> startup time the price that zsh has to pay.
>
> $ zsh --version
> zsh 5.6.2 (x86_64-apple-darwin17.7.0)
> $ cat ~/.zshrc
> # Lines configured by zsh-newuser-install
> HISTFILE=~/.histfile
> HISTSIZE=1000
> SAVEHIST=1000
> bindkey -e
> # End of lines configured by zsh-newuser-install
> # The following lines were added by compinstall
> zstyle :compinstall filename '/Users/pengy/.zshrc'
>
> autoload -Uz compinit
> compinit
> # End of lines added by compinstall
>
> > Also, Zplugin can load plugins after prompt, I load 20 plugins, and my
> > startup times are:
> >
> > repeat 5 { time /usr/local/bin/zsh-5.6.2-dev-1 -i -c exit }
> > /usr/local/bin/zsh-5.6.2-dev-1 -i -c exit  0,09s user 0,04s system
> > 117% cpu 0,111 total
> > /usr/local/bin/zsh-5.6.2-dev-1 -i -c exit  0,10s user 0,05s system
> > 119% cpu 0,130 total
> > /usr/local/bin/zsh-5.6.2-dev-1 -i -c exit  0,11s user 0,05s system
> > 121% cpu 0,129 total
> > /usr/local/bin/zsh-5.6.2-dev-1 -i -c exit  0,09s user 0,04s system
> > 115% cpu 0,119 total
> > /usr/local/bin/zsh-5.6.2-dev-1 -i -c exit  0,09s user 0,04s system
> > 117% cpu 0,109 total
> >
> > I even load prompt after a default prompt, ~ 100 ms after it. The
> > Star-Trek console-like impression this gives can be visible here:
> > https://asciinema.org/a/156726 – much is going on, automatically, in
> > background.
> >
> > > --
> > > Regards,
> > > Peng
> >
> > --
> > Sebastian Gniazdowski
> > News: https://twitter.com/ZdharmaI
> > IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
> > Blog: http://zdharma.org
>
>
>
> --
> Regards,
> Peng
>

  reply	other threads:[~2018-12-07 16:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 16:27 Peng Yu
2018-12-03 17:37 ` Vadim A. Misbakh-Soloviov
2018-12-07  2:19 ` Sebastian Gniazdowski
2018-12-07  2:57   ` Peng Yu
2018-12-07 16:13     ` Julien Nicoulaud [this message]
2018-12-07 16:58       ` Peng Yu
2018-12-07 18:06         ` dana
2019-09-04 10:13         ` Peng Yu
2019-09-05 19:00           ` Roman Perepelitsa
2019-09-05 20:30             ` Peng Yu
2019-09-05 20:37               ` Roman Perepelitsa
2019-09-05 20:45                 ` Peng Yu
2019-09-05 21:19                   ` Kaio Augusto
2019-09-06  9:35                   ` Roman Perepelitsa
2019-09-06 12:57                     ` Peng Yu
2019-09-06 13:11                       ` Roman Perepelitsa
2019-09-06 13:19                         ` Sebastian Gniazdowski
2019-09-06 13:44                         ` Peng Yu
2019-09-06 14:10                           ` Roman Perepelitsa

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=CA+mcLN5dpscPNhpsKoA0j8tvcUh2-A7KOX7wNQYFQ7q3sdg+SA@mail.gmail.com \
    --to=julien.nicoulaud@gmail.com \
    --cc=pengyu.ut@gmail.com \
    --cc=sgniazdowski@gmail.com \
    --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).