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 a353a243 for ; Fri, 6 Sep 2019 13:12:07 +0000 (UTC) Received: (qmail 11697 invoked by alias); 6 Sep 2019 13:12:00 -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: 24214 Received: (qmail 28706 invoked by uid 1010); 6 Sep 2019 13:11:59 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f54.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.54):SA:0(-2.0/5.0):. Processed in 0.808977 secs); 06 Sep 2019 13:11:59 -0000 X-Envelope-From: roman.perepelitsa@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.54 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=0/xr3LvbmZ80/vV6ezoazruVmc8Jj78ycdXv/1w3q4Y=; b=srGTP0zfX5qy2m1doMopY6B9kR8C75jVBw772pLerR8WzUTty0Gm9vXEcd83QJTRDW ksoQtKYwGruNEWqDDUWePPBR0SK9XGC6p7Go5N2s68z8fnL+ppVKk2+07ZZ6XOdo/0UE TejzPYdN2ymulKJnlRFsVjdz4tffGs61jl+CE7klSj95tq8blKONiWdl3x1MWYWNhwJw YuFrF0Laq/GzhXaxuwmf8uq7urFgRpDRqcmoDi6B3oicnfrWT5GWnsS1Ut+uATTDWNcN 18E4rzTisQpXM4pauegy0WALATQxJKLw5wYX6bj6AkOjnB0lLHtoTGDMC+BtWCJkuS4F mI/A== 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=0/xr3LvbmZ80/vV6ezoazruVmc8Jj78ycdXv/1w3q4Y=; b=Q02XRNyNB3NUaDxg0B1La//YxTiE3j7438SfBexOKz0nCazqBj0ZMXVU0uJtbjniah kp4k3/jEUvT03YzxS0MMVQmkj0funqqVS+HXaZq8o2fXmNCjUdQacL0Q55KgL0Mko6d9 pxGl36lv5Hucrm1AQOFntO1L+MupC1udEapoV1nd49uOdXzCQCin8YHm0ysQXgSEWnvx YW+6U/Agj+F+BhJnaA9ZNbbID997aLFbSyuI7nueaQTnbFil2vY7qjanq85nW/AzRcO6 XTNBBtPfM5Wzvl8grgdQwUC9xYCeCzjyhV1eLvf30fZJF12UkIBvnWwJGOwwnjOFUnjg sh0A== X-Gm-Message-State: APjAAAXH/Wg4Ns5CxbKqwaA389jAcnFP8/pPmcL2BXWT6Vc7oiTRGtb3 P8PLPxlCifMg5FWJ1x4mDBzEvPvc+a0LnkF5DAr8Iaa6CejbAQ== X-Google-Smtp-Source: APXvYqyE8ntJOsAepCMaavUhkAHreesSUOTp0wr27crhPz9+uPWW+ymRyiq6yAlGyQVvGyywB28kQbcPuq/Bi0rkx7M= X-Received: by 2002:a5d:8996:: with SMTP id m22mr1806237iol.39.1567775486277; Fri, 06 Sep 2019 06:11:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Fri, 6 Sep 2019 15:11:17 +0200 Message-ID: Subject: Re: slow startup of zsh (1x slower than bash) To: Peng Yu Cc: Sebastian Gniazdowski , julien.nicoulaud@gmail.com, zsh-users Content-Type: text/plain; charset="UTF-8" On Fri, Sep 6, 2019 at 2:57 PM Peng Yu wrote: >> >> >> Perhaps you can change your code to spawn fewer zsh processes? > > > But because zsh is much slower than bash... This isn't a fair summary of your benchmark. It would be more accurate to say that zsh on some systems may take up to twice as long as bash to execute an empty script. > Only if it is faster than bash, I may consider using it. Could you share some details of your environment in which the overhead of 6.7 ms per script is OK but 12 ms is not? When running a script interactively, this difference shouldn't matter. 12 ms is practically zero as far as human perception is concerned. When running lots and lots of scripts in a tight loop, then it's usually better to change your code to avoid spawning so many shell processes. In zsh autoloading functions is often a good solution, but the particular code changes will depend on what your code looks like so that it results in so many shell processes. Roman.