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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26320 invoked from network); 27 Apr 2022 13:59:33 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Apr 2022 13:59:33 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1651067973; b=oH9/6lbicFT8Tmyc27pb4ThG/RDVMuk2ep5VM+JJDjRF9xuG3teHR61PI5Q4h4OBLzgRiI0bUa uTbJNWdh3xH1shuQyriwjjbytrJrExhA5E5VfeYFN9+e7xIhKMWJeCIVWJeG4FLT38HIGLkLOr 6jZfdYXLl+0MZ/TyC1Izq6tgAObolC/zECyJn6nNM2az9gVTE8AWRQjW8nwbEbGkXcUt67yILA SDPTSTQHFprYYz0D38hPyX2KTVCkcbBNVTUjb8Pb/PBKAOrB0Ko5GnGUNARljXmYi/dpSgfcHE Q3zlzeFneyT68I6PiNWNwjNdBziRkF00hhZoakBLoV5Ojw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd00005-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.5; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1651067973; bh=5IqBZAZl+5G7mt+41V3cv9rAHgocHn9WdaragpKYMSg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:References:Message-ID:Content-Transfer-Encoding:Date: In-Reply-To:From:Subject:MIME-Version:Content-Type:DKIM-Signature; b=YksMBrS5vKH7cfNlhL39kuiN9LCpgKm1es7p4Ty50qGVeG5s8WrO/qJXmm0DcmI4QzsVVAhEnz A9kmSNKUD5b/3HnVZ66IJSKyng4GW16VWXbQrY1UIQcBb6wDlgSa7y4nADMoT/0yH9phY14m7Q MIudsN7kCdza8B8Monlq3s/RPUTBDkufpfURGw9EtrmstkTQS2xOQcQDNh7La8OABJH/Xwfamv 9M8xrgpMH5jtrRbR315yazqEzQK+B9jPxnyoldaj/JKMdGOfWXfkUop+fa2JTaQld2VJwem0B+ d2dWNsSIJiMT7e7hUz+zZZvC8ui372KqNFEvUbYDfYJ4cA==; 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:To:References:Message-Id: Content-Transfer-Encoding:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=raC7WLB/pkLYdzEYGdFJUk9EUr39qWckOkInG9a44bI=; b=H8MDnhD3Zew6p2H8L/QIkohyyw TRFEmscldvYkeHrhn3XCgybTgIcv2YoPUtuo+YGptdvM9e0u+dzd3ZNgVa9Uglvd0Eye5zSIdr3BN KfbM9FzBsaXHi/BfnCJnlZGZF6cz71WykGJgrOA8ood5GqzZnzdVXLG/RfIUFsWQR3DzYoHQZTWZE DVY+VpnUZIiVRAYkTJfwiZeChCAEg7857Qlsby6Frc5zQnC517FZaQuETLxhmbhS4YKP7U/ui+cbn 69Tt9Ohi6h5l7slYUknsCB7K59JpAQn1YUcUu29jgUd+pnpKdcKTTivCVUGS/ukLRtKKxQkNFMABM pNZp7IQg==; Received: from authenticated user by zero.zsh.org with local id 1njiCa-000ENL-ET; Wed, 27 Apr 2022 13:59:32 +0000 Authentication-Results: zsh.org; iprev=pass (snd00005-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.5; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd00005-bg.im.kddi.ne.jp ([27.86.113.5]:14881 helo=dfmta0015.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1njiC2-000E1m-1M; Wed, 27 Apr 2022 13:58:59 +0000 Received: from mail.biglobe.ne.jp by omta0015.biglobe.ne.jp with ESMTP id <20220427135851860.WCFS.122659.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Wed, 27 Apr 2022 22:58:51 +0900 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: ZSH performance regression in 5.8.1.2-test From: Jun T X-Priority: 3 In-Reply-To: <6AEDDA47-F8ED-4160-8FFF-8D3C70B12490@kba.biglobe.ne.jp> Date: Wed, 27 Apr 2022 22:58:50 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: <779E1EC7-7AC8-4B3D-9D9E-C0089320D163@kba.biglobe.ne.jp> References: <20220425192036.p6awbyro2a2lp7bq@chazelas.org> <7E5CB0D9-4740-486A-B55E-6EA0530532F9@kba.biglobe.ne.jp> <632293647.60210.1651052061990@mail2.virginmedia.com> <6AEDDA47-F8ED-4160-8FFF-8D3C70B12490@kba.biglobe.ne.jp> To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3445.104.21) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 50116 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: I did a few test to see the performance improvement. mkdir tmpdir && cd tmpdir N=3D400000 for ((i=3D0; i tmp.txt ln -s tmp.txt .zshrc tmp.txt contains 400,000 lines of comments (and nothing else). tmpdir/.zshrc is the symlink to tmp.txt. Then run the following 5 test (in the tmpdir): (1) time ZDOTDIR=3D. zsh -ic exit (2) time zsh -f tmp.txt (3) time zsh -f < tmp.txt (4) time echo 'source tmp.txt' | zsh -f (5) time cat tmp.txt | zsh -f total (approximate) CPU seconds are (tested on my iMac): (1) (2) (3) (4) (5) zsh-5.8 0.9 0.8 6.6 0.8 8.2 zsh-5.8.1 0.6 0.5 0.7 0.5 0.8 zsh-5.8.1.2-test 5.7 5.5 5.7 5.5 7.3 lseek() patch 0.7 0.5 1.4 0.5 7.8 bash --- 0.5 0.5 0.5 6.8 (bash --norc) (2) and (4) are almost equivalent, as it should be. With lseek() patch we get "reasonable" performance for (1)-(4). (3) is somewhat slower, because it is reading form stdin and need to call lseek() many times. The column (1) in the table above shows that both 5.8.1 and lseek() patch are about 8-10 times faster than 5.8.1.2-test. This ratio (about 8-10), obtained with .zshrc that contains 400,000 lines of comments, is close to the ratio reported by Jordan with his .zshrc: > 2022/04/26 3:16, Jordan Patterson wrote: >=20 > Summary > 'prefix/5.8.1/bin/zsh -i -c exit' ran > 1.16 =C2=B1 0.06 times faster than 'prefix/5.8/bin/zsh -i -c exit' > 9.22 =C2=B1 0.27 times faster than 'prefix/5.8.1.2-test/bin/zsh -i = -c exit' Jordan, what do you get by the following? zsh -xic exit 2>>(wc) Can you try the lseek() patch (in my previous post, 50115=E2=81=A9)?=