From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 8016227A7; Tue, 09 Sep 2025 15:19:29 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 411AD279E; Tue, 09 Sep 2025 15:19:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fout-b7-smtp.messagingengine.com (fout-b7-smtp.messagingengine.com [202.12.124.150]) by atuin.qyliss.net (Postfix) with ESMTPS id D550C279C for ; Tue, 09 Sep 2025 15:19:25 +0000 (UTC) Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 5D0401D000E1; Tue, 9 Sep 2025 11:19:24 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Tue, 09 Sep 2025 11:19:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1757431164; x=1757517564; bh=F6bg4mpCxg pUTc+XGsBTc6AFYelqCFlmYu5VV03NLQw=; b=CGMUCH8OEI8W2ZsbXYO6w1g9sr E2jVmR7kR543LfhcL1e+iN0b/ze58Kw/FeVl1sIBt5UmLgPG9P2i61XTsi+JSQAU Xpt3wWi4Omd+fNbZ43yxsmJfe7NLFZxJWtL8TRJdmnqfaPbgAXO1zJ2oZG7Prd+g FTwE7aEupOrS10YcJGKEcoTZdDYLRqYpq5Fij7dGoWfHkAJd0lO/xwumm2sGmLT4 No+gi0K5iMSECtvJoan+Nam7gWyaBxA1eLddOzdjG7ZhZ3K5+dVKwo61GIQX/2bQ wT3c0fz6792a70mJJK9g+YxL9bMChnPsSzaHI8g4hTU3z+7r4faygA8qy6iw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1757431164; x=1757517564; bh=F6bg4mpCxgpUTc+XGsBTc6AFYelqCFlmYu5 VV03NLQw=; b=MzAbJ2u5mMmaEBXLhqbRztyjRkQ8ChsUIu/zoH46+zznj5qFZeu Wmx1Qi/RCupWPooAFH1yhaRvE5cjfJLuzcJIgE18IYF9p8HgRDfC0sGLcjn2qePV lLVxp5dRergoxsmT9VCb61cJeFreYi5iUvEQnw1myRpPabxtGyRkYP8V5brwu0Ux EgsAH8CKiaj84GRKMOfoV613AwEGh82df1t+20jnIssfnUkeojhB3tdjc9/g3Rxe 9Cj6+ES/FJU9+xXT+HoeRFj36ZIxPYjjXRVt30ghk4uCxX9UDoGNjqSqTppJqZoo DLCH06GH5YigXbGOiNplKgu4/ADd8jiea1w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvtdejiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufgjfhffkfggtgesghdtreertddtjeenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepteehvedugf ejgfehhfeijeduleekleejgedvkeeuuefhhfegvdevfeetveegteeinecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrih hspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegu vghmihhosggvnhhouhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvvhgvlhessh hpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Sep 2025 11:19:23 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 7676616C4A2D; Tue, 09 Sep 2025 17:19:12 +0200 (CEST) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 02/20] scripts/make-erofs.sh: Do not read one byte at a time In-Reply-To: References: <20250904-systemd-v1-0-2a63b790a913@gmail.com> <20250904-systemd-v1-2-2a63b790a913@gmail.com> <877by9l5e3.fsf@alyssa.is> Date: Tue, 09 Sep 2025 17:19:11 +0200 Message-ID: <87h5xb8xhs.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: OH5MP6JB5VACR6YBKPO6SFHEMH2CJ2O4 X-Message-ID-Hash: OH5MP6JB5VACR6YBKPO6SFHEMH2CJ2O4 X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Spectrum OS Development X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Demi Marie Obenour writes: > On 9/8/25 04:23, Alyssa Ross wrote: >> Demi Marie Obenour writes: >>=20 >>> POSIX requires that the shell read builtin not consume any bytes beyond >>> the end-of-line character. For non-seekable files like pipes, this >>> requirement can only be met by reading one byte at a time, which is very >>> slow. Avoid this by reading the entire input into a temporary file and >>> having sh read from the temporary file. Since regular files are >>> seekable, sh can read many bytes and then seek back to the correct file >>> position. >>=20 >> Slow enough to make a noticeable difference in the context of the whole >> script? > > Don't know =F0=9F=99=82. It's just a known antipattern and > I saw bash using a decent amount of CPU time. Did a quick (imperfect) benchmark of a full make using hyperfine. Actually came out slightly slower with this change, but difference was statistically insignificant. (Without the change came out 1.01 =C2=B1 0.08 times faster than with it.) So looks like it just doesn't matter either way. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaMBFbwAKCRBbRZGEIw/w onZYAQDVmQneJFlBCxz7WEIOin6mLB/EEFo5lTwJTQYL7e1DdgD/SM8iDzfikIeH maO1LwjtzQQ5KOabJQVmXtvIWmLqhQ4= =Jzyf -----END PGP SIGNATURE----- --=-=-=--