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=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 bda46172 for ; Fri, 7 Dec 2018 16:58:41 +0000 (UTC) Received: (qmail 4671 invoked by alias); 7 Dec 2018 16:58:28 -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: 23801 Received: (qmail 3622 invoked by uid 1010); 7 Dec 2018 16:58:28 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f169.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.85.166.169):SA:0(-2.0/5.0):. Processed in 1.458488 secs); 07 Dec 2018 16:58:28 -0000 X-Envelope-From: pengyu.ut@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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:content-transfer-encoding; bh=4sezPoybxygJY5iTdPPxufu+qdCCzsyTfpuGyLACiUI=; b=Avzh0STMUh3xgV+oyF4/OgBtemQfsKZ+HvjWk/dEi9yynUtiSaWeK9ihuckwYx3S6d LKwXq7VxkkniBOEFOA0MXgYHLocZvhR6SF2HntYQVaLZchZN5chav9Fk1QfmUnY6zgFm sVO4lb8NZueVsgBdLrFaBCmbo4yO1SBtXn5hJs+trQKNCHVTcn08ImZMhvBeq3fNwRE8 WmvrGJMvOV8hYNFMs0aEK0R9iuGAj8lHWi9aX9/PAFNakvEup+XTazVfmEPG9tSwlpKU btw6tPXprkkXKnXyvX+u6VmiYMUFrbWJjyB+XDdh88RjWjpKBsJi67mgEKvWUfMZtUQZ w4tA== 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:content-transfer-encoding; bh=4sezPoybxygJY5iTdPPxufu+qdCCzsyTfpuGyLACiUI=; b=nVWMdmvMHm6B6puIt0ZLjSRItisQLPkRC8P8HG0bpDnJZdDOAofAMWgMDbJLpT9VLf 0p9nb4mFbJ4WM3r3FhlkpxDrin6zz7eJG3wVaTzwIdrAgaM2n2l+UTEW7RX39oY+lau0 njoUup10EGwqn4RFC727T7biaZYh5ZiAmkbpBwvuUkMXiBtvJII57b3cz5fcCYEeWbVV NWnq6gEKU51eeLL9iP8Gyf4R6oJkgdm7iuVM3KZvq4v86Hx3WigchUzKmnwXp9JSWOYV EPhDlq7AWncmX+OC/GVOf4GecRYuffmi4vvP8j39ZoyPyT/hTDf/ciZVk8GV+3YiCuo0 V5LA== X-Gm-Message-State: AA+aEWbTOHR/m8qOCAdcnVbx9eu8D5Sa+958PJhqcKQ8b0xV3qRExyw9 4yc5c7LFwq0Zg3YsPAxUKhTn/uBGeGwRpQDbe2wAlO7C X-Google-Smtp-Source: AFSGD/Ud6x9HNse0qESN2SCrxV+M7540ZKDhmFfQEmEi/kmfrKKRdAK/AIiS3EgDRahXFKQTMe1XPf0jG16ddBHuc2U= X-Received: by 2002:a24:8e43:: with SMTP id h64mr2602691ite.26.1544201904358; Fri, 07 Dec 2018 08:58:24 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peng Yu Date: Fri, 7 Dec 2018 10:58:11 -0600 Message-ID: Subject: Re: slow startup of zsh (1x slower than bash) To: julien.nicoulaud@gmail.com Cc: Sebastian Gniazdowski , zsh-users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 tha= n >> > > 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, automatical= ly, 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 --=20 Regards, Peng