From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32660 invoked from network); 30 Nov 2021 08:34:12 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Nov 2021 08:34:12 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1638261252; b=GfjLqaPs683Dt25y5gF5wGNFo1ByjKeKFE1VgKdxsyIazeYgHEGNE3srQgGeBIlgY/5HTkskvM U0jKYDJgt2yHF4iqgEvHMDNwP03Nv17XYwraEfnDwoCmXcStLLmOfzbH98JHCQnY4UY65AkRxC jQ2BwVgtyAHqLU4td5S6sWVvJHRCwqJLREFBRgOD5i09ugbIQrjGPQTgHVQRKtwpfHq7BVfRjU Oj73RT9S78w9qtfxaK3YxSlPYHVGDlHjMlSJcvzq7jrC/4BPIq3j9K+CMOb1Xzler7k/VxgBcj 7pBaCKEo99asCpDASfQM68BfFm0LekK1w5oDnOlp4lCPlQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wm1-f46.google.com) smtp.remote-ip=209.85.128.46; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1638261252; bh=pg9cjw5RvyEfDL8OfdTH70W1ShFdEQKnyEsoSkPZT4M=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=j0wTiC07/EEam0zvNWN/XlwoNiavLlhtaU/hQLA7XDh/I2Yn9Zrlv5JEVOydR262BiG1TgHSmu OKYy29v+LEjyfF0x8D0Me+IUFpYetI3y36mH7cL9ERdN+YL5hfmp1IeNzMOqto8NkdfuAdBJZz t3wAI8us/ldSgMDIZmWejpjZqLnaug17sg0ScWr2lzF4fXyMpwFDUe/4zsmNTBtse4grzTW/zw tBAa9WE5PssBI8jc1Q9q00Tzx9oWIqC4sXvvCCEFdfw3ZY4p45DkrY/S2XMPH+DYfcYU5rA/MJ QWWiSWr8HjU3Hk7B7aI1CRP0sfFLGrqCaLL77wQfvRGOZg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=qD4bGgLDkAu9NKE6YtR3/RkP70qhhwSmBhI7yXcqWcQ=; b=UbYZ2+FNT1tRpC9AHg6tI6Rl9x 5b8ewJYIJ/Oq4WZIjxCb5450cZ/hVDl3c9XK2BZ7fGqE2tpUZiDcELdNzGlvk9CUPz5PXVv2dTjdW cPKxYfIFGeynLpqyZrFfp+AByYGGSGnZhPxLrRyxP+whbnAGDGrkJi6M/7xHDtK2ggpSVUqSDi7iD COT6HxG3hdptir8GNEMPzj1+SJDmE/JEt/5d/8wtyZ0P9TFbG25nQe0vOeI7cS9eGg6/ZOcnIESBl jSEPuJsr/Fj8MUKTztKuEJ6aXid9xBxCTtEkQlo3QJX3ohJVSn6pGibajOmmqbNakT8u2t+3+eRwp a18bcJYQ==; Received: from authenticated user by zero.zsh.org with local id 1mryaZ-000I2Q-Vb; Tue, 30 Nov 2021 08:34:11 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wm1-f46.google.com) smtp.remote-ip=209.85.128.46; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wm1-f46.google.com ([209.85.128.46]:37532) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mryX2-000G5T-Fp; Tue, 30 Nov 2021 08:30:32 +0000 Received: by mail-wm1-f46.google.com with SMTP id k37-20020a05600c1ca500b00330cb84834fso18867850wms.2 for ; Tue, 30 Nov 2021 00:30:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qD4bGgLDkAu9NKE6YtR3/RkP70qhhwSmBhI7yXcqWcQ=; b=awi2yj+iF/QXlEH8tsHx4+SwAxI4gvenxqc8WJn4lqmwV1oybO8yM4SIEl+bQImGA7 EdPkR+XT2fo9m6ByFCzo6NnaNDD2BOvgu4n0NUkjvweibzpfBSQPyC4G6/Vgxl6+Dfgh xB3foCx9e+7mT2Kx+rndeN60sCxz5Ke+IH8r68Y+9Tewefpm3mD8s6lraLTxjonXH3GL EQZR/qetJS6Py9Mhnc7vkNuUbiTaeqsfmIQfDaHKnmyqlQAM9KxFxptSS+iG38UQu+6N 58pMGtzrzLMj+MqGza7L9+yMQiGHx82WOtkxafeUpIIc5ZRD+XTgHeFg+ZELKHTzrEfm 7DKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qD4bGgLDkAu9NKE6YtR3/RkP70qhhwSmBhI7yXcqWcQ=; b=JuAUG8WEO3aLa6a34yl7jTakDlvE0OXQJF+3Ti2Tsn5jF6XvBM8XQ9+xXutwbzqHTM dWOdhVOjC6DU7aJn/L5geUYTturyY3KSz8HBUPWwcAOn6vgVzrYzy9GVzzjduPqab+Oe cEwpA27rJTEwHT9UGxnVZyXPM/374EARsVdY7tQBPoE6SimH3kKcb/yao0/CAAkRGUTx vTeyajoo82VaQ4F/Jlu6J5GNUeAHjOB/i7OGnhxVo7q+7b0S+cMJAaoSxbcYyTGHRkh9 2vjgkj/voH2NNFcQhdbAD0gP3M6SpHyfqs1dxJkUuv5MwTGlez5d8OiCvKa9uBt+PBNf yaxQ== X-Gm-Message-State: AOAM5308OFC+LhXIolJnwtgYqGak+IvlH6MiMe+MrtEDG14kWU+4XQsR T88DI1dr5QI5P68HCHH9nD18rpcbXzvOsqXGwb3IK94W30o= X-Google-Smtp-Source: ABdhPJyilwWzY+5x/+/5mfK5HyEKNoFXJ7Fmiinpiqp9A/blzpkEKRqR9KPjQvdgLRcEooVLl2rokEgUtE5pklMcId4= X-Received: by 2002:a7b:c94e:: with SMTP id i14mr3236068wml.85.1638261032041; Tue, 30 Nov 2021 00:30:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Zach Riggle Date: Tue, 30 Nov 2021 02:30:20 -0600 Message-ID: Subject: Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits To: Mikael Magnusson Cc: Roman Perepelitsa , Zsh Users Content-Type: multipart/alternative; boundary="000000000000dd41d605d1fd5ec8" X-Seq: 27400 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --000000000000dd41d605d1fd5ec8 Content-Type: text/plain; charset="UTF-8" And here I am all the way up at ~600ms startup lag ($EMPLOYER has a busted Python3 distro that adds a lot of ms each interpreter start-up), but very low prompt lag. *Zach Riggle* On Tue, Nov 30, 2021 at 2:28 AM Mikael Magnusson wrote: > On 11/30/21, Mikael Magnusson wrote: > > On 11/30/21, Roman Perepelitsa wrote: > >> On Tue, Nov 30, 2021 at 3:30 AM Zach Riggle > wrote: > >>> > >>> The benchmark I used > >>> > >>> $ hyperfine 'zsh -i -l "exit 0"' > >>> > >>> > >>> Obviously this is not the BEST benchmark [for checking shell startup > >>> time] > >> > >> Obviously. It's the worst or at least a strong contender for the title. > > > > I think it's fine to do this (assuming he actually meant -i -l -c > > "exit 0" (missing -c in the quoted command)), if you don't do any > > weird stuff in your startup files (like you mention in your "how not > > to benchmark" section). Assuming your startup files are synchronous, > > the above will tell you how long it takes to execute your init file > > plus some other overhead, so if you do something and the number is > > lower, the thing you did will indeed make startup faster. If your > > startup files are not synchronous, then obviously nothing I said > > applies and everything you say is true. BTW, the above command can > > easily be improved for worseness: > > % time (repeat 1000; zsh -ic exit) > > > >> Since you care about interactive zsh performance, at least skim > >> through the homepage of zsh-bench. It'll save you time. > > > > % ./zsh-bench > > ==> benchmarking login shell of mikaelh ... > > zsh-bench: cannot find prompt; make sure it contains hostname or the > > last part of the current directory > > > > Sadly no time was saved :(. > > Got it running by changing prompt_pat to %, > first_command_lag_ms=48.233 > first_prompt_lag_ms=33.816 > exit_time_ms=32.177 > > I'd say these values are fairly comparable :). > > It would be very useful to have an option to benchmark normal > interactive shells instead of login shells btw, my profile runs stuff > like fortune which is obviously pretty slow in comparison to startup > code, and not at all interesting to benchmark. The quoted times in > this mail is with all the -l removed. > > Also, you recommend against zcompiling .zshrc in your document, but > first_command_lag_ms=56.709 > first_prompt_lag_ms=42.367 > exit_time_ms=40.885 > > Increasing startup time by 33% seems like a bad tradeoff to me, then > again, I know exactly how things work and am not likely to make the > mistake you mention. > > -- > Mikael Magnusson > > --000000000000dd41d605d1fd5ec8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
And here I am all the way up at ~600ms startup lag ($EMPLO= YER has a busted Python3 distro that adds a lot of ms each interpreter star= t-up), but very low prompt lag.
<= b>
Zach Riggle


On Tue, Nov 30, 2021 at 2:28 AM Mikael Magnusson <= ;mikachu@gmail.com> wrote:
<= /div>
On 11/30/21, Mikael = Magnusson <mikach= u@gmail.com> wrote:
> On 11/30/21, Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote: >> On Tue, Nov 30, 2021 at 3:30 AM Zach Riggle <zachriggle@gmail.com> wrote:=
>>>
>>> The benchmark I used
>>>
>>> $ hyperfine 'zsh -i -l "exit 0"'
>>>
>>>
>>> Obviously this is not the BEST benchmark [for checking shell s= tartup
>>> time]
>>
>> Obviously. It's the worst or at least a strong contender for t= he title.
>
> I think it's fine to do this (assuming he actually meant -i -l -c<= br> > "exit 0" (missing -c in the quoted command)), if you don'= ;t do any
> weird stuff in your startup files (like you mention in your "how = not
> to benchmark" section). Assuming your startup files are synchrono= us,
> the above will tell you how long it takes to execute your init file > plus some other overhead, so if you do something and the number is
> lower, the thing you did will indeed make startup faster. If your
> startup files are not synchronous, then obviously nothing I said
> applies and everything you say is true. BTW, the above command can
> easily be improved for worseness:
> % time (repeat 1000; zsh -ic exit)
>
>> Since you care about interactive zsh performance, at least skim >> through the homepage of zsh-bench. It'll save you time.
>
> % ./zsh-bench
> =3D=3D> benchmarking login shell of mikaelh ...
> zsh-bench: cannot find prompt; make sure it contains hostname or the > last part of the current directory
>
> Sadly no time was saved :(.

Got it running by changing prompt_pat to %,
first_command_lag_ms=3D48.233
first_prompt_lag_ms=3D33.816
exit_time_ms=3D32.177

I'd say these values are fairly comparable :).

It would be very useful to have an option to benchmark normal
interactive shells instead of login shells btw, my profile runs stuff
like fortune which is obviously pretty slow in comparison to startup
code, and not at all interesting to benchmark. The=C2=A0 quoted times in this mail is with all the -l removed.

Also, you recommend against zcompiling .zshrc in your document, but
first_command_lag_ms=3D56.709
first_prompt_lag_ms=3D42.367
exit_time_ms=3D40.885

Increasing startup time by 33% seems like a bad tradeoff to me, then
again, I know exactly how things work and am not likely to make the
mistake you mention.

--
Mikael Magnusson

--000000000000dd41d605d1fd5ec8--