From nobody Tue Oct 10 13:36:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S4cPV45Cpz4wmc6; Tue, 10 Oct 2023 13:36:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S4cPV3YWyz4Jl4; Tue, 10 Oct 2023 13:36:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696944990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rypW1HadBpQ3tDFYEB+2kRMbQb+pvHh6sYIzPztdd78=; b=d6GKOlmJpU3KoEVnuuEqAHQpjY6N6Pdy/PTapT49UX6Y4gGBvuEw5BT9nzA/t8Pv2oqSnB GPrcn9Pybd3qg0iNvmyaO6Pu1i4JrxVtgs0Vxka+HlNx0kGkydAa+YhkIGPeCfW4TSlx/I RcPolcr/Sb6KeJfqa0HosM8QNd22wJuoultVmAm+jMLUk3dJe65EwAUM6jqc0Bm2tJ1KOO WCsADc7sSloQZ+4fJJKmrVymAhAqJQ+uxUl+YGdnQ1r01cfNP7uJ2oLUpOpu+7ByFBrlte VsaQRS4HJiro9ViDY/v7rSpVEHAuBl3jDcb8wXHvYpUQAt+zbxZjf/DM+4jkGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696944990; a=rsa-sha256; cv=none; b=j64wuIz2EhLPAjvxwdyEugItpz1q3TxA0iNu+TCdgA1VSLjlYtV5l1Qx/Zr/rNRUNecVX0 CwxjRIPj3NtgJj+vzbfwDxX/urMS2W+ylF7cqLvz33cpR8XUXIDfwC272lX63Pzm2RyYe2 UxKxiOSk3zswKlBRRfLo9yZKuNY/N8oMB4QSoKpSC1Lx05EdcXHWKoddNsAExvRVO0zsc9 8F5I4QHFwUN3RPKdgcAA9mRTWjzKDLS0KU2VLC9GaUYsbRuUkPYYbZHFm6+7oyP2vGDNmj /VC2Djg2lvUPAvrIGFdSnGkNzafSOqXjynj64FZL/X6ZtYYqL7peJwwUfuIlkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696944990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rypW1HadBpQ3tDFYEB+2kRMbQb+pvHh6sYIzPztdd78=; b=OQcNYO+5vcHbLkecRZN5DqbCvApJMGme5jrVrj2TCuTK1/uXn946K5gApbbH4kqouQ+bxT 0cB+W5Pn2+0Gttz5FzQ6rIWheTXj6+FZ/YqmRl8+Aket/zqTLW8g2oK0/EpEpHq/q/iBLl Hn4QL1PL0bDMuOWoomWFBCpBJs/M4kNT4MQ9i9915HZkHJCS5ghCzXL0yqiY0BODnp2UgZ zYxsA3UWfkdUcoRDHsRNhq8r2jNZSN/Ew6f3yozJ6iJ1MTs1Jm2SycYQwe1aX19bw15Uhp T32lFNitnExksUjpsV9JtPtce2F+TkO4LLpS8Qlw43BkbNHp8+uEA8yXJLAXzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S4cPV2ckrzgLx; Tue, 10 Oct 2023 13:36:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39ADaUuQ005393; Tue, 10 Oct 2023 13:36:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39ADaUiW005390; Tue, 10 Oct 2023 13:36:30 GMT (envelope-from git) Date: Tue, 10 Oct 2023 13:36:30 GMT Message-Id: <202310101336.39ADaUiW005390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f098b537c932 - stable/13 - Speed up *-old-* make targets by using sed instead of xargs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f098b537c9323a6677dc549c9857a6e805405022 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f098b537c9323a6677dc549c9857a6e805405022 commit f098b537c9323a6677dc549c9857a6e805405022 Author: Ed Maste AuthorDate: 2022-04-01 22:58:00 +0000 Commit: Ed Maste CommitDate: 2023-10-10 13:36:10 +0000 Speed up *-old-* make targets by using sed instead of xargs Targets like 'list-old-files' used "xargs -n1" to produce a list with one file per line. Using xargs resulted in one fork+exec for each Argument, resulting in rather long runtime. Instead, use sed to split the list. On one machine `make list-old-files` took 30s wall clock time with xargs and less than 1s with sed. Reviewed by: jhb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34741 (cherry picked from commit a8267ecc3df0aa633daa56360d67a24f9b1d3961) --- Makefile.inc1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index ab9a9451299c..e0f5d9cae72d 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3225,7 +3225,8 @@ list-old-files: .PHONY ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" \ -V "OLD_FILES:Mlib/*.so.*:S,^lib,usr/lib32," \ - -V "OLD_FILES:Musr/lib/*:S,^usr/lib,usr/lib32," | xargs -n1 | sort + -V "OLD_FILES:Musr/lib/*:S,^usr/lib,usr/lib32," | \ + sed -E 's/[[:space:]]+/\n/g' | sort delete-old-files: .PHONY @echo ">>> Removing old files (only deletes safe to delete libs)" @@ -3292,7 +3293,7 @@ list-old-libs: .PHONY -V OLD_LIBS -V MOVED_LIBS -V "OLD_LIBS:Mlib/*:S,^lib,usr/lib32," \ -V "OLD_LIBS:Musr/lib/*:S,^usr/lib,usr/lib32," \ -V "OLD_LIBS:Mlib/casper/*:S,^lib/casper,usr/lib32," | \ - xargs -n1 | sort + sed -E 's/[[:space:]]+/\n/g' | sort delete-old-libs: .PHONY @echo ">>> Removing old libraries" @@ -3333,7 +3334,7 @@ check-old-libs: .PHONY list-old-dirs: .PHONY @cd ${.CURDIR}; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_DIRS | xargs -n1 | sort -r + -V OLD_DIRS | sed -E 's/[[:space:]]+/\n/g' | sort -r delete-old-dirs: .PHONY @echo ">>> Removing old directories"