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 15034 invoked from network); 26 Apr 2022 15:16:32 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Apr 2022 15:16:32 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1650986192; b=aGdfuaDn7oCLKT+mKQAq0NDm6SJ409VlOoNBpwbKFuIzl0wVJ7kn86rV0b+OVp4Ep9OuFJTHqG LzVsUthf+sSNiC+bmDXYcIaKrfrPgrA3U8dzxfhSyxsb8NLA/2PErb/RlG7iOPKxxQDHKxZHir tLeKn+uwxKtOJxXdD5SKY27eqY/FFv6buhgfJ+pQhqaDj0GlJJue6+sy8xT+Ej1VN5f+KfXjnn UI12+FZqw2USNZHhc3Y26/r8rSmbsj1qyA+OqMCxorxgdK06vzHgv1MOBcgFRe62nrMWj57m1e +C8a3DbeEazg2CAxIHH5hYgcam25aIGd44tohbJnnTjiUw==; 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=1650986192; bh=bJv+xjz5KGPP7msRjXVVHw9vdd/QqTw0zEIDfqVphho=; 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=By6bo4yv/IqVhFmWljzGiaiCgxvrULzjJ86H/WxqDt50sRex5MDSCc/XqLsiX2sH84BE/skO2G WZXqMFCctPjl7vv2a6EFiwyI3QAeTcvZZn70FNYcq8jnx0rBUpolTDQwhkZzfTZFgPxTt4+NRW wIsK2t1MUw69thoiuymGHqek+hx6PE5yFni3jWKja4s0hGoh6Hs/FuLblBFGTmyO94mD6cJylv 5UJn+EcBzLFYTnT4tisxHy0uHw1PU6uFK7GjEJZ8SxOLFsq4GpaN9i70i1D2bJ8BMc6gOt9J+L JO6xiRSgA3Ycro+Oijw/751eFpJQdoO9OAEHLKaPGuO+Jg==; 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=0hqFAPUTSI14f642g+N3zM6dWTeU7KA1PBPJHalHrG4=; b=TyYz07Qd48hMhmn2BECvemXiSI 8lKqZz5olIKR8hQ0WXkVM6YzBT3oeG4uyQAKBxHezebcIY2xQDY7T7jfdp4WcQ2+iTPuV5c8/rapE JeFoDhWNjVJYamHlRJpOARW3+NdPKdqt26t9b742XBFkn1q14j6ZrDnONp+Rlaw09uYfWS3SePcJL sVe+PGy5srkQsHqujCS5M7WdsOqFHpoCjzgZ9rgPQIIXL8oHVT7VPCqThCmcO0O3Jx6LRBMTabqSN 5d1d3pa3G6gem91U4wcnBYwv9cMRPzFzMoBdQYZhghRhx+VIJnDknp6iP16JKpdIvYFJ3JLXjU+ax QQ0OhJBw==; Received: from authenticated user by zero.zsh.org with local id 1njMvX-000PhQ-Hc; Tue, 26 Apr 2022 15:16:31 +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]:49096) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1njMuy-000PLb-I2; Tue, 26 Apr 2022 15:15:57 +0000 Received: from [212.54.57.82] (helo=smtp3.tb.ukmail.iss.as9143.net) by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1njMuy-0005yA-Ay for zsh-workers@zsh.org; Tue, 26 Apr 2022 17:15:56 +0200 Received: from oxbe13.tb.ukmail.iss.as9143.net ([172.25.160.144]) by smtp3.tb.ukmail.iss.as9143.net with ESMTP id jMuyng9uwMHIvjMuyn1h6r; Tue, 26 Apr 2022 17:15:56 +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=ZYEOi+ZA c=1 sm=1 tr=0 ts=62680cac cx=a_exe a=wuFMYA7voKp1dZz7Z+vj5Q==:117 a=wbvTLvLwOfMA:10 a=IkcTkHD0fZMA:10 a=7H6ixmLU1AQA:10 a=fRaytwG2PJEIImbM2TkA:9 a=QEXdDO2ut3YA:10 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=1650986156; bh=bJv+xjz5KGPP7msRjXVVHw9vdd/QqTw0zEIDfqVphho=; h=Date:From:To:In-Reply-To:References:Subject; b=BSnL9egbcDEbdNBub00S5hQMRqgPtzulAnuIsgIx/m6RN/V3XE98jlVsTmaxkR+g8 UJgLKN5n8RTPgX7HfD1SYCrGU5Vtu32GcxHIaZzjqy3abVmJjda0E7F5MQ0NKOuMuA lAIHSfN8UXnaR13GzIxhODdypRnauBoBB5436A1uFFSEqqn+WhPDhWGoQ4Ipb2dERG tgZ6LEehJIYkM4IGj1sGbfDqquy1kWIh13TunRO8xezvi0d9x2XnYSdAja1mvvHadV Ego+Bgg9bDOht2uXDiTZEziGET1zihuchmRAmcAw0CUHPRx1zieyJVMrxa9p2JxWPc U6cNTDjrN1/aA== Date: Tue, 26 Apr 2022 16:15:56 +0100 (BST) From: Peter Stephenson To: zsh-workers@zsh.org Message-ID: <875081227.118208.1650986156051@mail2.virginmedia.com> In-Reply-To: <7E5CB0D9-4740-486A-B55E-6EA0530532F9@kba.biglobe.ne.jp> References: <20220425192036.p6awbyro2a2lp7bq@chazelas.org> <7E5CB0D9-4740-486A-B55E-6EA0530532F9@kba.biglobe.ne.jp> 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: MS4xfBiSlFnk9ng6yB8bWFAR3QsOJ2UUGrFh+yvyBHPqZW6cdEDbVcv7y/p6LYMhamxptNGnDullVti475qaku79wbER/5aTEr5BzJCdihpvjLqfUnh8bfSy 25nJ4mWEtwH94m0ENQWj1rJReXIf2ME4RCb5LFtrQZ8WHU4PVN4zKv9GhMHfJu6HEKj9cnmR2r5Jie5VBX790rYvXzTskMoMCHAIgsxm4bOlSMXEBACW3HMJ X-Seq: 50108 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 15:31 "Jun. T" wrote: > But at least on my Mac the following seems to work also: > > if (lseek(SHIN, 0, SEEK_CUR) == 0) > rsize = SHINBUFSIZE; > > # Have you found a case in which lseek(SHIN, 0, SEEK_CUR) fails > # when it shouldn't fail, or does not fail when it should fail? We could use some variant of the following as a configure test for safety. (Not sure if the socket test is comprehensive enough, but we must be really into edge cases at that point.) If we get the equivalent of lseek on pipe failed lseek on UNIX domain socket failed lseek on regular file succeeded presumably we're safe to use lseek as a test, and if we don't we can decide whether to fall back to fstat or just leave unoptimised. pws #include #include #include #include #include int main(int argc, char **argv) { int pipefd[2], fd; if (pipe(pipefd) < 0) { printf("creating pipe failed\n"); } else if (lseek(pipefd[0], 0, SEEK_CUR) == (off_t)-1) { printf("lseek on pipe failed\n"); } else { printf("lseek on pipe succeeded\n"); } close(pipefd[0]); close(pipefd[1]); fd = socket(AF_UNIX, SOCK_STREAM, 0); if (fd < 0) { printf("creating UNIX domain socket failed\n"); } else if (lseek(fd, 0, SEEK_CUR) == (off_t)-1) { printf("lseek on UNIX domain socket failed\n"); } else { printf("lseek on UNIX domain socket succeeded\n"); } close(fd); fd = open("seekfiletest.tmp", O_CREAT); if (fd < 0) { printf("creating file failed\n"); } else if (lseek(fd, 0, SEEK_CUR) == (off_t)-1) { printf("lseek on regular file failed\n"); } else { printf("lseek on regular file succeeded\n"); } close(fd); return 0; }