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 f15eea89 for ; Fri, 7 Dec 2018 02:57:09 +0000 (UTC) Received: (qmail 1124 invoked by alias); 7 Dec 2018 02:56:55 -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: 23799 Received: (qmail 15581 invoked by uid 1010); 7 Dec 2018 02:56:55 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f171.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.171):SA:0(-2.0/5.0):. Processed in 3.992455 secs); 07 Dec 2018 02:56:55 -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=ftkREbL1WKsDXmrHjg7W5e/dUcaj7rTZ/LaNVQkB6ug=; b=Nqv0ES3Ems5UKUNrTU7lh9ZVqGVzOjOp35VlVP6leelXGVthxKzlsZoua3hQYvJI2y Rn7ojZCfzWOOwzOnJygaLEAf0RR1SAO2UnQc8JIN7X1nJu2rFvFb4YDZnOe+of66YdjA 2QJZu0n5t6/s8PlJAPxiigf6FVowldYSA18SDBesxE95iRfIJfJ39WSef+ULV/TJBoby kSNdmAhe1qIx8hczeFHULfoaJDII1I2kuoN5fVatJMplu0OY/l6lrpWJDuOE2eD48qt0 CfjGXMd/Xx3Q0JLF4quR5Yu306kfAkL2AjSZQuW1DZ3uu7MftanSRReITTbrZEoAzodk 4Nxg== 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=ftkREbL1WKsDXmrHjg7W5e/dUcaj7rTZ/LaNVQkB6ug=; b=kPVmMNc57XxvY0HV8HAc7VRyIqtrllgJ4G4LdqIh8FTYYIE/PovFBRtF7s82sr6KZg mbHBJ0GJm6rq22wsnuW8Vorhro9XtWn0gokVtL6ari3cwoRvIBxCustCCBAYC3NZLrf9 rJJd7B76GIVu3PoRgcc2oFfQvRNv8flB20oLzEEVg8Mt6+hezEu06I+0HNhZ/hcIpDp3 jvkYIg37Zn5nJorQbFZFT9HfKXmJKtiMi22Vjk2GF6POMPmy1Af7OpD6C7UsNso7TcY0 xfHgbRkLnkHZfJqPrdIOKO0RVk3cz7iT76evQQRNk5K9FjbF+lAhh5B+9bpwEvm4kefm cnfw== X-Gm-Message-State: AA+aEWavHXwvtLFx649jnh0nItExByRw1rhORMs5SSELYEXFoKXwbeCY Yxiezkp0Xui4xJMgepg8DE/Ism9I8WCWxXmHb5g= X-Google-Smtp-Source: AFSGD/Wq0LFVWtUZnJ4D/gMhRxprPLXCWji407Nqd7WBucekOYnfdXtgBxGMSo7ToJihCchxRhZgfE4kmV1976zUBno= X-Received: by 2002:a02:242b:: with SMTP id f43mr398123jaa.144.1544151408651; Thu, 06 Dec 2018 18:56:48 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peng Yu Date: Thu, 6 Dec 2018 20:57:03 -0600 Message-ID: Subject: Re: slow startup of zsh (1x slower than bash) To: sgniazdowski@gmail.com Cc: zsh-users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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, 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 --=20 Regards, Peng