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 51048B2A; Sun, 21 Sep 2025 18:36:49 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 37D19B17; Sun, 21 Sep 2025 18:36:47 +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-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) by atuin.qyliss.net (Postfix) with ESMTPS id B50EEB15 for ; Sun, 21 Sep 2025 18:36:45 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfout.phl.internal (Postfix) with ESMTP id E19A1EC012A; Sun, 21 Sep 2025 14:36:43 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Sun, 21 Sep 2025 14:36:43 -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=1758479803; x=1758566203; bh=9b42pW+I+l BWUILNvfeyWy1C0+Hx1v4jvTF++dQ+zYA=; b=LY7TzJmPep8s6p8qcNqjCb8JH0 4YHVoo9oObN/9P16mHePc4duVno17XlmqrV1jkecSRpIg3km5B69NtHJrglk3DR2 uqBpKMnBoq4W4YML2oBEDCLIlAzOQumVvX9o3mbsfWpu7BAh8I4mNWNReBqcGLnL V6tKy21BG8Ag3oBI/Hf6M6skdy/n6IOMdABpbtbGIMeRRZw6cpo4htB0IV9hmuE7 oBXbY5C3y2fWozjhAsKquFYLQIv8WK0KI6PALmMSZ+bgQiDuu1Pl7Zdn7Is0L8yy qHRqu63jqUdaOR50PGCnoiKO4SxydmpbyI9oaMyGsM70h+salm1Wh+Ahljcg== 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= 1758479803; x=1758566203; bh=9b42pW+I+lBWUILNvfeyWy1C0+Hx1v4jvTF ++dQ+zYA=; b=lPTRVUIV8Ws85W8dWrI6ZVWtHAt+c9aQ9rYBldgHjIAHyp4Kvzl DSYFm5AXb8+zz5dUXWAJ7i/0vCski4JCgfGBSgkpk9Co5QBNvITKbQCztxRsvdyt /laxeBRz73tKgcRevLsjGLuMfdn2XSTPAvbzyDaBLia2iL5OOVIokqc+8pZqVPaL LTlBV1WOctSV1hpO94sn3Tym4RT1+XeTUz1yGqULYWmyqyUOzSYo+cbhwrMbiDfo BdTZ8pKl2/n+/ygdNHI2bymLvV4yrWhFgjg3Zp/uY0ssekTSpDQGeSW15bIa/eLA dlVumTN9nT32ULGptzxLY6LXIv06BVEU7Bg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdehheejudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufgjfhffkfggtgesghdtreertddttdenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepieduffeuie elgfetgfdttddtkeekheekgfehkedufeevteegfeeiffetvdetueevnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrih hspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegu vghmihhosggvnhhouhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvvhgvlhessh hpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 21 Sep 2025 14:36:43 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 5591024BF837; Sun, 21 Sep 2025 20:36:32 +0200 (CEST) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 3/3] scripts/make-erofs.sh: Avoid unneeded calls to mkdir In-Reply-To: <20250919-less-dirname-v1-3-5df7ca617b9b@gmail.com> References: <20250919-less-dirname-v1-0-5df7ca617b9b@gmail.com> <20250919-less-dirname-v1-3-5df7ca617b9b@gmail.com> Date: Sun, 21 Sep 2025 20:36:29 +0200 Message-ID: <87bjn31wlu.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: DQS6F7DYKS7VUXAJLOC3RF62ORJTN5HW X-Message-ID-Hash: DQS6F7DYKS7VUXAJLOC3RF62ORJTN5HW 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 Demi Marie Obenour writes: > Don't call it if the target directory already exists. > > Signed-off-by: Demi Marie Obenour > --- > scripts/make-erofs.sh | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/scripts/make-erofs.sh b/scripts/make-erofs.sh > index ac62a65f53e0b6417b164f475a537960fc5203bc..30b83b0b41cbe7bc4fd7786cfcdddcf10c78cc5a 100755 > --- a/scripts/make-erofs.sh > +++ b/scripts/make-erofs.sh > @@ -44,10 +44,15 @@ while read -r arg1; do > # a subset of all paths, but this subset includes all of > # the ones passed in practice other than /. > case $arg2 in > - (*/*) parent=${arg2%/*};; > - (*) parent=.;; > + (*/*) > + # Make the parent directory if needed > + parent=$root/${arg2%/*} > + if [ ! -d "$parent" ]; then mkdir -p -- "$parent"; fi > + ;; > + (*) > + # Parent $root which definitely exists > + ;; > esac > - mkdir -p -- "$root/$parent" > cp -RT -- "$arg1" "$root/$arg2" > done I saw a statistically significant speedup in hyperfine. :) Reviewed-by: Alyssa Ross --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaNBFrQAKCRBbRZGEIw/w oua4AP0fG2YmANyG+Kp1tNF2kA5X1PqHp1872pJifs/dc8hVbAEAu/W8ADby3S/q SIi4ztbQw0ENgjSeESKhM/ZSo7Csqg0= =yzSb -----END PGP SIGNATURE----- --=-=-=--