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 5595 invoked from network); 27 Apr 2022 15:29:11 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Apr 2022 15:29:11 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1651073351; b=o7+q469yj4rv/2v3KX/Fp5NIqw7AbNzT4ENi6YfCkmMJogFKVpB1e6+ZMXVZlz+LFTk6rZR9AO TKwijG2dM/ceMSr82Zq7D5cup2KG7PmPGSsnW2MFY4kgZaznfzqTHu7TuKM+oO4ouXD/b5sPSP Wnyse5R7rpGW+MH1FJr3+0/lzkRTVg2fxSCN1d9SWRWKVGtO6usjjZCNV7XxRVybUlBcbF2GBi 5j5gFDyz9QBqmznAnlL6gNhrUz9zLam2GsTEzmsnG0MtDqhoU2nERgphTYKJQQf/VUwpwHI/Jy kJGi6mfm9TQOBY+1MvMOU3PTwYmfdsBAN6yWm6zjA6JP7Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f52.google.com) smtp.remote-ip=209.85.208.52; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1651073351; bh=rDfmugISKfW8XQyfs5e2wFnHNdnhK+PfsPg877mZwpc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=lAoJXP6RX8K9jSoN2iFpBUEzR3flZ4gparVf30NVHCV6yISIvH9hfScZYkU7NmsTuNZIyGk+HJ xNxGs0cIHT+DN+X1tRWRvK5dsppgDX0wiRoFQQNedm3mbhVrqVi1W8mA62spCjOuQ2wQw6UAy0 pR4qMkzqJcbFYK5+bWhmwl60rghcrKy5+oY2PBXZe+8aQMco4VwWhv4h2SrwjcjlGPMpCSWUkv xL1hrtDSPuGr7JAqitG3JywwAbneHTxwyFCRp4sgCcvMRL9SlO2YlVx1xCnj6Q8scH9+x1l43r gxqA/Nsdm2G3TlWZIUssAqHmcqbCKEqB/Jo9DH3FHfgvVw==; 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:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=dDTTWiCd29H7Ztq7Zpi0D4+V34zWNe6JgAN7e2etBUo=; b=ZekWFQ8Y7yjsFLt8zGARssAoKo Vq2jETTad1uqPnWevtUyf7EQFF3bIpYs4YmcJYrlErNniTQkHJu7rpCqam3qTR1Coq2d56v0coKLt t0iAb6Aj7UO1PinByai+2oZKwbsFoS6+of9AEZ3B04V7VPIKIhcrXhpav7pViq9zxDhTR21FLb5Om xIoWndPjnozzOZgjsh429i6gC52jc4qo9jx0x1z6mVWP91HjdNSAgvBHu03FihNNEa5Ab3CyqeKIa RYmvd1ZbYO+o/z1LQE5s+RGM5V2RGSZv2RDctadNyVOzSG85Qa3Xiw2vKyI4pRLc/hcOh44vNscU1 S8EY0y8A==; Received: from authenticated user by zero.zsh.org with local id 1njjbL-000KMH-EW; Wed, 27 Apr 2022 15:29:11 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f52.google.com) smtp.remote-ip=209.85.208.52; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f52.google.com ([209.85.208.52]:45722) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1njjXe-000JpM-DU; Wed, 27 Apr 2022 15:25:22 +0000 Received: by mail-ed1-f52.google.com with SMTP id be20so2336105edb.12 for ; Wed, 27 Apr 2022 08:25:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=dDTTWiCd29H7Ztq7Zpi0D4+V34zWNe6JgAN7e2etBUo=; b=Jv4tsqhX2IpRbA7AiM2pSY3GpCurR+lhvL1nKyYIagEXjng4yxoMiAtASP325ZrHQR j4WEkbAFqen5WPcHZf9XWsOMr4dkz2Wbvw3I1UwzOWvhbIJigjKwVbo1Zhm1qIytEItd M2QLRR/ejcvth9ShE/Ybig/GuaopbwPsVATC3J2hqqw8hsTFH8ttnRpE/RUHWLOjTea7 0Dw/PjZ1g23AM0BTlIWwXH7kmuBxNkS9F6zkg5ZPsDdjbJ3RixdHlsrNCrgtWcTqTycI mDCN/IZD+zBeTM/kAIhqIqEc6tXPJiFU12l8SFNMUvGhwLvYNKMdxPgs/qSq/2onQaPo U5cw== 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; bh=dDTTWiCd29H7Ztq7Zpi0D4+V34zWNe6JgAN7e2etBUo=; b=pY6s8XSKTzeuH6Jx6Jo5SsBqSTNQT+0/kkZ7O7w9NK3o6lHLKAF05HlFFpOpogI6Ob 7+pdwHXM8oWEkEf9aZ4p3eHiuG5/k35O6v/HnNDpDQ5UqPr0f7RXTs2oNh8WaBevumHy kL9zj9zJi98jHg2tzbUn1V+XFfKb4wM6U1roMZxbATguAfuZO3YdOBfPoRazUotv/4fB ptF6gxWjC3fy/EFWSltc5Hwp08JoVdUA6cc3dTDetrRcxMxwqNMnUVYrratR10H6elzT itWkHSlNpPGZiCT+wMwzyw4oCH3GFPLDRhqVuHugs0REsxSmieChAR1tDuZbmRJ0jr7m jRYw== X-Gm-Message-State: AOAM532fqu1U6W1TfcHJIFNDMpumik9FOe5kIIjHoXYi9vbTYlzYcJLU ZvxPaMrjf62H/5cI6aQ61P9fwS1uZXZyCx2MJbCeqwVymJ3W7A== X-Google-Smtp-Source: ABdhPJyBVRSNsFl+B2v20+8k7xQogWvNggoN526i2ZmL4Okx5k1CbkWYkj7w0zdVse6fh3YTjrQmAxvyTRex7fwJNg0= X-Received: by 2002:a05:6402:2815:b0:420:c32e:ebe2 with SMTP id h21-20020a056402281500b00420c32eebe2mr30497280ede.1.1651073122175; Wed, 27 Apr 2022 08:25:22 -0700 (PDT) MIME-Version: 1.0 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> <779E1EC7-7AC8-4B3D-9D9E-C0089320D163@kba.biglobe.ne.jp> In-Reply-To: <779E1EC7-7AC8-4B3D-9D9E-C0089320D163@kba.biglobe.ne.jp> From: Bart Schaefer Date: Wed, 27 Apr 2022 08:25:10 -0700 Message-ID: Subject: Re: ZSH performance regression in 5.8.1.2-test To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 50121 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 Wed, Apr 27, 2022 at 7:00 AM Jun T wrote: > > Then run the following 5 test (in the tmpdir): > (1) time ZDOTDIR=. 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 Does it matter to (3) if "zsh -fs" ? > 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. I wonder if it would help to read less than SHINBUFSIZE when SHINSTDIN. E.g., make some guess at the "average line length" and read that many bytes. Might cause more calls to memchr() but less I/O (and shorter lseek()s, if that matters).