From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 090abeb8 for ; Wed, 4 Sep 2019 10:14:43 +0000 (UTC) Received: (qmail 12961 invoked by alias); 4 Sep 2019 10:14:33 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24199 Received: (qmail 16024 invoked by uid 1010); 4 Sep 2019 10:14:33 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f46.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25559. spamassassin: 3.4.2. Clear:RC:0(209.85.166.46):SA:0(-2.0/5.0):. Processed in 3.691195 secs); 04 Sep 2019 10:14:33 -0000 X-Envelope-From: pengyu.ut@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.46 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hkN2B+Z5VEmRuuH4EvQazTJvJsgBN6ar3SjAWhBsjQE=; b=qrszAC8hBF2l3X4/zuIGJxzUS/6MQrhHbhhqxYesx4EdYkbSCqRORUu0sipnVpwMoq XMgbkRBsd28vEIXiJ1nqTN1nTfB0rt/w8+F9WL6ikGpbgBTP4/XKzeEt0I5zSrWWNDR5 v8Jq5CKMlPJcZf5NlhaOIsEKbTs4N1B4+X/BS22YnfQBrYV4S9FyKdC4vib8sIfpU34+ 5xEQli2xWfMcOFd7X9WUmNv1YPMWAuoaznMsSZzyKChWJsMqIl6D2TV5VR/fVmCFaykQ Wi/p8IVu3BNTnrFF2muQ4+CdCp4h5WgXnGc+FQYwqX28DfYGgwLLClxXl0ilktv8hTph 7NnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hkN2B+Z5VEmRuuH4EvQazTJvJsgBN6ar3SjAWhBsjQE=; b=GmHaQ2H6qyLoMpBqOvfuWe3shkfr8gYoEu7CFj0pvvVqNDu6Vpk2rYS7oLQjXjSPL+ LqkuqlwrvVfvgNI8DZp60jNlk/H0wvDrH3bsolnFEuxJozobeMEtjTyFmUbCXk/+mXgq SnFjqP7upQPnPdscoXu+Mz6hLevhwCG7a8IA/fuRRtWJZDor0Ld3TqUVvcDfADykniqg rQfQLkv6K8IzCvuyXGryzX1A8mbfZ4FGhkS/3XubnPi5V70/9fJJdXwBjrEM3ZjfB2Ip /hYIMbqMhyiiQgc9l0lGR0EYdcM80ZzzGCH5WwKwXF2kKaFynvRnmAo4cT76Y2UboceX +08A== X-Gm-Message-State: APjAAAUukymKu/ccrxS0Sux0zqxa1c8i6m6KncmIZhQDxBMXs8DJ5Oay PruAc/Dq2vLabYT76ulhJNRZTM9hgmydcvX8vc0= X-Google-Smtp-Source: APXvYqxER/WrG6s/+6wSJMDzS4dbgU3RYwfX29NvnEBE38B1fG6Ujl4xKD2XT9HPT0Drrm/MYcoiEaypvLoJwcWEWV4= X-Received: by 2002:a02:c7c8:: with SMTP id s8mr3133890jao.121.1567592035917; Wed, 04 Sep 2019 03:13:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peng Yu Date: Wed, 4 Sep 2019 05:13:44 -0500 Message-ID: Subject: Re: slow startup of zsh (1x slower than bash) To: julien.nicoulaud@gmail.com Cc: Sebastian Gniazdowski , zsh-users Content-Type: multipart/alternative; boundary="0000000000007427d40591b77699" --0000000000007427d40591b77699 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Are there any consensus on how fast is zsh starting time compared with other shells? My test was on Mac via homebrew. On Fri, Dec 7, 2018 at 10:58 AM Peng Yu wrote: > Not on my machine. > > $ ./main.sh > time ./script.bash > > real 0m0.719s > user 0m0.264s > sys 0m0.324s > time ./script.zsh > > real 0m1.295s > user 0m0.360s > sys 0m0.680s > > =3D=3D> main.sh <=3D=3D > #!/usr/bin/env bash > # vim: set noexpandtab tabstop=3D2: > > set -v > time ./script.bash > time ./script.zsh > > =3D=3D> script.bash <=3D=3D > #!/usr/bin/env zsh > # vim: set noexpandtab tabstop=3D2: > > time for ((i=3D0;i<100;++i)) > do > /usr/local/bin/bash --norc --noprofile -c exit > done > > =3D=3D> script.zsh <=3D=3D > #!/usr/bin/env zsh > # vim: set noexpandtab tabstop=3D2: > > time for ((i=3D0;i<100;++i)) > do > /usr/local/bin/zsh -fc exit > done > > > On Fri, Dec 7, 2018 at 10:14 AM Julien Nicoulaud > wrote: > > > > I don't think so, zsh is faster than bash for me without rc files: > > > > =E2=9D=AF 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) > > =E2=9D=AF 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: > > =E2=9D=AF 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) > > =E2=9D=AF 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=C3=A9c. 2018 =C3=A0 03:57, Peng Yu a = =C3=A9crit : > >> > >> On Thu, Dec 6, 2018 at 8:20 PM Sebastian Gniazdowski > >> wrote: > >> > > >> > On Mon, 3 Dec 2018 at 17:28, Peng Yu 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=3D~/.histfile > >> HISTSIZE=3D1000 > >> SAVEHIST=3D1000 > >> 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 =E2=80=93 much is going on, automatic= ally, 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 > > > > -- > Regards, > Peng > --=20 Regards, Peng --0000000000007427d40591b77699--