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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29636 invoked from network); 26 Apr 2022 08:32:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Apr 2022 08:32:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1650961935; b=c+0ti6X0tE2JeXAquKIAFdox6AY+PWh143SY0H/0/r8rg9wbxgtW/t2dYNFGkSvIJsDJjK9xiT 0wwTTFQlRsJWc8vncVFKKjLBMPjh9RAi5DOxP0UzuvzpQ3NNTYeUB3uNz61IU8F/sZi9cEhDwT liwvQqn1CEKkJ9pY0hwp/MzFZwc6cbqHzTgI3T3l+2UTJZxjYuMr72alc+fWa4w2qT8XGXEiRY MpkAFjfCSdn5LZmNDYXlg0dwdtajpxDpxKM1BNBw8/LyAxoyXZBNzG46USyHtMLMA4GYjI1RGl 8rLnBNp1VAWu27TaBiaNApoXJW62v6ORPb0UoGJ30LPK+g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1650961935; bh=edapLewiR6yagdGGlTBqy1pruOUaBUEUBnfjaZd0TJI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=Qun9E2/FdvepqgSTfnTGT5pc2Ib5YW7lr2X2lCA2o/T7ZRtlbd+czn4P7hS5omwOHPZfqAdrTz z+1eEn4KJ9Yv9V16xt43v2JeHQC1ngF/lpXwO3G4IrNDMtCsZLyiaceIQ8d3RE5d1oT0s2GZh3 z7ANqUuecPxfDrcwYYB6PJe/hGPPyeIFs/tNhSu//RAitZ/CidNjfTeazm8kyFbmH4mZhhoD9w fW8I47u2QkwsyJPzPqC4Gm18v23wB3Wg522l3SwIGFcsm7GbwNdlCWJ9uyuV6+W9KueWpYCBy/ 0LBW2SBEyEUiqoPnyYHFZGERAjARXJIsZAxhqGeq6dYH4A==; 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-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=OP5mhKomkct02Qmy/qEW1FEVT+gnDTS1o2oUakyfoj0=; b=YZLYSLjDPmeFOOWK/At+eaVrUs FSszYfy0YZXpRfWyx6WJykjevf1fPWwZY68NcHkemkUhMKElpasMCIZPVG784MC977RddvuqP80EE 2TLPeDvW7MekLyHH1WvpSFbBnHEo7D3x46dSJKMfZVr7l2fODQBACzxhk6uAR/iVI74oJFFQRVSQ9 wX2lzoMRkGlqT1BIF15M4vjaomXtDN8a0w3B7UWBbf/9OOCpKDQNT5Idzjuf5ZPVH8ZvZ+kca82Rx eAR054med2Y8ZDp135FVBf/0YkU1w8S8yqOVmjloDpt2oe7DKzx5v8O5rQvOCSxIQzO958XV4waTQ +pCnVvqA==; Received: from authenticated user by zero.zsh.org with local id 1njGcI-000CsY-99; Tue, 26 Apr 2022 08:32:14 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:60398) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1njGc0-000CXT-AV; Tue, 26 Apr 2022 08:31:57 +0000 Received: from [212.54.57.80] (helo=smtp1.tb.ukmail.iss.as9143.net) by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1njGbz-0001s4-MX for zsh-workers@zsh.org; Tue, 26 Apr 2022 10:31:55 +0200 Received: from oxbe13.tb.ukmail.iss.as9143.net ([172.25.160.144]) by smtp1.tb.ukmail.iss.as9143.net with ESMTP id jGbznvPtig8LgjGbznrYKu; Tue, 26 Apr 2022 10:31:55 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 172.25.160.144 X-CNFS-Analysis: v=2.4 cv=cOTzD3SN c=1 sm=1 tr=0 ts=6267adfb cx=a_exe a=wuFMYA7voKp1dZz7Z+vj5Q==:117 a=wbvTLvLwOfMA:10 a=IkcTkHD0fZMA:10 a=7H6ixmLU1AQA:10 a=q2GGsy2AAAAA:8 a=IPxQnOKUx1hk2SP-wlYA:9 a=QEXdDO2ut3YA:10 a=z9dJwno5l634igLiVhy-:22 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1650961915; bh=edapLewiR6yagdGGlTBqy1pruOUaBUEUBnfjaZd0TJI=; h=Date:From:To:In-Reply-To:References:Subject; b=FkuLBP5AHyalEejxdWaOFzMWQeCr5vNScSAGHJ1G6IqePKncEeqmAS+iNahGEPip8 r7eizYij25lF3+SHtRbEr0U3xbLqCLMsYiOZ3pmRPJdVw4hqvSgwqnJDNLbFoWRAVc JoF7Z9evWN8ym+YgBOTEtHCKNaRrIoTHbzYJWhyprpJeQ/czNGgj5ExNnle4FOVwgu ybHGUYA5blEmrb3JJLFdQbuppxu0XpIW/XoI62MfowYpMCynNi/ZmBWIsFaTdtykYZ yTGhuocvDsiG94cN1HbT79adJdlhzIMMNPu07/H897YWVHUn9Ifd9kjn+G6Gf+CVJl y04W5JQmB90yQ== Date: Tue, 26 Apr 2022 09:31:55 +0100 (BST) From: Peter Stephenson To: Zsh hackers list Message-ID: <1592299421.100566.1650961915601@mail2.virginmedia.com> In-Reply-To: References: <20220425192036.p6awbyro2a2lp7bq@chazelas.org> Subject: Re: ZSH performance regression in 5.8.1.2-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev72 X-Originating-IP: 147.161.167.85 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfO/lEm1l0wvWlFBV0hkA40SONJmf2vwjeDClkVh2Gs7qTSpf+Hsn7q5WwjiDatGmga/qRFiWJ4bKDuxybGaNm94dxtfMEMjyAwuscHvI8iGhVW+TP0+k e1hCONSP1TYur/xlnwN9TkOq0t2ZnNvRG/M4h5BBNs2O5kLcUSwIYCnY0g7U7oLKGIm1DomDaLltnKQI3jCTr8v/VBN+mypWrDb+2HbFgR6nQ1Iwq5HG7Kxj X-Seq: 50103 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: > On 26 April 2022 at 08:01 Bart Schaefer wrote: > On Mon, Apr 25, 2022 at 2:27 PM Bart Schaefer wrote: > > > > Theoretically we can block-read with impunity in cases 1 and 2 (anyone > > disagree?). Testing for seek-ability would allow doing the "read too > > much and back up" trick in case 3. I don't immediately see any way to > > avoid reading one byte at a time in case 4, does anyone have a > > suggestion? > > Try this? So the supposition is if it's not a pipe, providing we can detect that, it can be optimised to a block read an a seek. That ought to work most of the time; presumably the thing is to think of nasty edge cases where the test isn't good enough. You probably get away with it most of the time even there, in practice. Not sure how much difference it makes but to avoid additional system calls we could cache the result, invalidating it when we open a new file. (We could even cache whether a seek unexpectedly failed, but that might be getting too paranoid.) pws