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=-2.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,MISSING_HEADERS, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8830 invoked from network); 27 Apr 2022 19:55:12 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Apr 2022 19:55:12 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1651089312; b=cIAOFz7eqJeAPrKS6FkbvQb7KofPoxKb5tQoO5+QuRIsQEqCGlyvnMp56QhTeHPaSESEXZeqVa jF5DeStgeI7qFNEpR9fgrUhdLibU9sCiWspmp5Y+ArEDcVViCZf4EeZnTgQ2qDnOQFrTmTFd13 gyenB/xxOwNImBBc2DjZrzUvwTJueHezTNzWVFp85gILQKxzrJHAuzOwQmD/3hJCaA+w3tMHJg JNTncUm0x3rcxDXLBexJm/93kIWRnppcw40105gNyLGKVuaOuXCgeDWL+BXcXSlO5v6kr5OlWb UrIZqxu+NEQdDFFZtBDE7Iw+8AsqTlaz7n1q94eVdvje4w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pl1-f172.google.com) smtp.remote-ip=209.85.214.172; 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=1651089312; bh=O2e2zbiYU+3ay8kOhp/cDwL83Df3QIxINPEWYPPOUV0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=AbdwV9l2gq9l+sFSXYVr4dTWj7Q00O09X+GO2GAkY/X2XKq4MTwwuH9ZhGyghZpQqjp1X4+gFY gUiIau/SgEr5nY1BHNxUmmKVU+8wdPOj8z+UzDXo6Hmd+zhhA/Z8ur+Jmv/UqEebl1dMIHR6Cy osrwX5TOVCNgJ2WofieJMeqXVeY8YszftFSyy68flNm3aA4BNC8mBEcxIIAEtlnygcyaBQ28PA MCZP5YQYs4D3bOmdW6G6Qj++SuTGeTsWjVhwdD7Pkhf7TE+Khq2Ltl77yHxxV5GtbnYEJoGu16 WVemNYwz3LjbD8wL45dW78w9kSU17ybiV8dtzgE3rF8pZQ==; 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:Cc:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=OUHN2oXYjc8d0csRGzvg0sUAxkp/IEj4nOyy4ztAiEc=; b=aoqbAt95kZOD4or9xMCbFU9fje sVJfebppOyBcxaaJmB3v+7ClC/N2D32SCenh+FL4H4FZm99ZSBnoDa4KoE64iCn7eWJhpvqgSbUk9 DNVBbodsLVYcYVIImacEbHfL+Q/IhECqLBl74F4+sntPTYkhXnGazKNHt6a7cX8oPWC+uvQaOi022 e0VM9K6ZAcXnO9mH+ZrjS5W+9DFjxJ3II1LbHhI636HdCtnkOiUsy6O1BnOqsq8VrBuefdSfo9N/a 948FLuXU8U3kSIumFpWBrAF4z81HnbJPqrrQPC21r3nrfHOlY3+g2TIpFwQdRqH47sa6HKkj/MRyR nb9ezdcA==; Received: from authenticated user by zero.zsh.org with local id 1njnkk-0003r3-8f; Wed, 27 Apr 2022 19:55:10 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pl1-f172.google.com) smtp.remote-ip=209.85.214.172; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pl1-f172.google.com ([209.85.214.172]:33600) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1njnkB-0003V7-Oh; Wed, 27 Apr 2022 19:54:36 +0000 Received: by mail-pl1-f172.google.com with SMTP id c23so2528838plo.0 for ; Wed, 27 Apr 2022 12:54:35 -0700 (PDT) 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:cc :content-transfer-encoding; bh=OUHN2oXYjc8d0csRGzvg0sUAxkp/IEj4nOyy4ztAiEc=; b=YoB+IPU9p9Nn28iM5XobAi0PBQlFDiJ+O3Z4f1k2ssbWcngPo9EVeY9N0nAx+nI7tn gI4aY+ruDq+UGyGHY891zAh7etfM0D4bOw1ejKpCPFvDNcEV7CCRIRGginl5wmVxz5Og 6Hd/KYP6gnyQVOWTu6RH2/34NX8ONbpZv6A8R1U4heWklnQT55YG0IVHXhVGTsZowF8C cxggoKTgNwwwuWU0q7hhVZUMhc9pk1UY3ExWuXAc2dA160f67B4LFTXH2jdpKVGDFUFf vx4VF0YJ/wqj9Jqw4ihTRkEwQ8q5uv/ZbYQCpWxsocrPzpzGAqVKrkWCQ0oIKseSqF8r xisA== 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:cc:content-transfer-encoding; bh=OUHN2oXYjc8d0csRGzvg0sUAxkp/IEj4nOyy4ztAiEc=; b=J4xVr6A2EumcYURYH9EtGRwdiV779/kZHRMHU1D59+5u3rQ9cekcyAq4BPHpIzuiPB 3lfWGRZSP8fn+zHyTtTikg6Q7Hd2U063sFGOg1WDHACW0/N3QpViN2SJoJcUAMU+xrHR bbceO+go6KeAKrbTrVNaaX8Pxq7tTfp85u7UcwDswrUXvS3nUmHXTitMuBfxXO/lpEyQ WpJ6WijY60cjl0/2DnQ27X/JgSewANZjyjyWQmpndaCmf2I7xpjBh0Qcp3kXYGRx0gVK xuoDZl1rgJyIRhrPK2xaEVEnNsyw/I0LoI5wdCmtuIWxDyLh40w1F/Q244zpAqboxbVz J3Hw== X-Gm-Message-State: AOAM532YQ5y24RHa14Z7aKo2IYSMU++yk7HzYYbtyt+1rWIYMFAWIVpu X2RaTM2qadUkEgUdONlm2hLlcj3NWS8YbRu17CG9oV2bPp9g2g== X-Google-Smtp-Source: ABdhPJzHhI4cQpCfqIclIpVQbpwHIKjJVZVjmm6BXka5WdN/H0g3dmI09+S5ClTGx+wubXsRjZiUwdKGqnmJdx9lQqc= X-Received: by 2002:a17:903:11c7:b0:151:9769:3505 with SMTP id q7-20020a17090311c700b0015197693505mr29790821plh.72.1651089273631; Wed, 27 Apr 2022 12:54:33 -0700 (PDT) MIME-Version: 1.0 References: <20220425192036.p6awbyro2a2lp7bq@chazelas.org> In-Reply-To: From: Jordan Patterson Date: Wed, 27 Apr 2022 13:54:21 -0600 Message-ID: Subject: Re: ZSH performance regression in 5.8.1.2-test Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 50123 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'm not subscribed to the mailing list so I'm missing Jun's original email, but I'll reply here. > Jordan, what do you get by the following? > zsh -xic exit 2>>(wc) I get 13007 lines, 1534161 characters. > Can you try the lseek() patch (in my previous post, 50115=E2=81=A9)? Sure. I needed to add a mode argument to the open in your lseek configure check. I get this error otherwise on my system: error: call to '__open_missing_mode' declared with attribute error: open with o_creat or o_tmpfile in second argument needs 3 arguments My benchmark results: Benchmark 1: prefix/5.8/bin/zsh -i -c exit Time (mean =C2=B1 =CF=83): 254.6 ms =C2=B1 10.0 ms [User: 174.6 m= s, System: 68.0 ms] Range (min =E2=80=A6 max): 240.1 ms =E2=80=A6 271.7 ms 10 runs Benchmark 2: prefix/5.8.1/bin/zsh -i -c exit Time (mean =C2=B1 =CF=83): 251.7 ms =C2=B1 8.8 ms [User: 179.2 m= s, System: 60.0 ms] Range (min =E2=80=A6 max): 233.3 ms =E2=80=A6 262.5 ms 11 runs Benchmark 3: prefix/5.8.1.2-test/bin/zsh -i -c exit Time (mean =C2=B1 =CF=83): 2.583 s =C2=B1 0.053 s [User: 0.516 s= , System: 2.033 s] Range (min =E2=80=A6 max): 2.540 s =E2=80=A6 2.687 s 10 runs Benchmark 4: prefix/5.8.1.2-test-lseek/bin/zsh -i -c exit Time (mean =C2=B1 =CF=83): 283.8 ms =C2=B1 8.0 ms [User: 202.7 m= s, System: 70.4 ms] Range (min =E2=80=A6 max): 273.0 ms =E2=80=A6 300.3 ms 10 runs Summary 'prefix/5.8.1/bin/zsh -i -c exit' ran 1.01 =C2=B1 0.05 times faster than 'prefix/5.8/bin/zsh -i -c exit' 1.13 =C2=B1 0.05 times faster than 'prefix/5.8.1.2-test-lseek/bin/zsh -= i -c exit' 10.27 =C2=B1 0.41 times faster than 'prefix/5.8.1.2-test/bin/zsh -i -c e= xit' On Tue, Apr 26, 2022 at 1:01 AM Bart Schaefer w= rote: > > 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?