From nobody Sat Apr 09 00:41:18 2022 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 4ABC0192603C; Sat, 9 Apr 2022 00:41:19 +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 4KZxBR05q4z4WNT; Sat, 9 Apr 2022 00:41:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649464879; 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=TDu3c/bK7xc2b4RhUWlkB3iitY0tCM7KC3D3RO+wf40=; b=ORS4YiYFrEQ3gTTStUH+wKxmb3mw1WqXk0EM6R2ePeICwmltwn51mJRwa//niV3c5NpNXu aHjS9rnBmLHClxMtSEO9qYDQp0FNIODWmSGhoH6feahpCQd17O923M1PDKM/lCvBMXp/s1 oTA45bmm1Qa5fKg/d3bl9QsYVFDrVJkaKQabshSKIhK9bnIxUKzNKKzpkh8/xSh8JnWuuf bRI6pOe3P0zaHmcKEt/YNAoz0gct4VjmRpyjoZ6IQO7ERsLd+8qRJMLaMdMWEJ5tQr2qPa yKyELvmoUbdf9sMI+1wdV03kFzTEffDU1Sq7bnFvMVKSjpmGB0JuaUmHwwmsow== 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 BABAF7C11; Sat, 9 Apr 2022 00:41:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2390fInC079228; Sat, 9 Apr 2022 00:41:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2390fIR0079227; Sat, 9 Apr 2022 00:41:18 GMT (envelope-from git) Date: Sat, 9 Apr 2022 00:41:18 GMT Message-Id: <202204090041.2390fIR0079227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: a8267ecc3df0 - main - 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/main X-Git-Reftype: branch X-Git-Commit: a8267ecc3df0aa633daa56360d67a24f9b1d3961 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649464879; 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=TDu3c/bK7xc2b4RhUWlkB3iitY0tCM7KC3D3RO+wf40=; b=jI2NGZJ5G3DwbdWLZpqEJDvvwO4apRikGSWhuWY3m5f6kBLUArahSJxxX/B7phWFPkwcyh x0xZSx4zOhCeZudOg+DrOYQ0/IMIKRF75F/9GLjpZIkSW/t16FX/vXEMqjD+V7ICdkndvv iBzDSSAtigM3QZ8U3IuUiMoSgdAm7JhvyUFtlwsl4YC4Ftag/ZkozuCs+wJRSwQYrZ3k1p kGlZjxxwJt8ISSl81fnzp84mxnLeAcL/qMM3WCCaRYeW0wrNBJZ+3/k8e6sRv6mXqwhVTZ rJESDka0q2DfvThlSrPaxwva42m+89zjsIycnw4y9qhKSFcJCpSdiBKeJ/ojoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649464879; a=rsa-sha256; cv=none; b=VFf/F/wtiAKYoIAQOfZZj52adD1+joTCKLJAzQFDw4i3GE1x1g55zz6F/x4SRKX9L5RGuy zplUapNnhFl+dVOxbue7P75OM3FlFE0g2w37i1GacsXbsbYDNboJdIGyx21B+NjrqoVUJd tjFomOPulj3C1MoniKTntaU5mzYoiEs0UHfNfjOidONHdg0ZcR23B5Lg5xGETCIU9+P1cv KVdX1mcBysfC1HNCvtvnOk9LeSOgqJ3rUnC8D9fflSAzPRTqgwXRzhiKriiPRIUmO4Bs5B J/9astOKAP6pwkiaIZ6OfOATEO0YIEDZtSIzHW9Dy4g6X1ahUT6mT9v/spA2rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a8267ecc3df0aa633daa56360d67a24f9b1d3961 commit a8267ecc3df0aa633daa56360d67a24f9b1d3961 Author: Ed Maste AuthorDate: 2022-04-01 22:58:00 +0000 Commit: Ed Maste CommitDate: 2022-04-09 00:41: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 --- Makefile.inc1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index f4d5b4cc8050..1f29e89881c0 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3208,7 +3208,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)" @@ -3275,7 +3276,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" @@ -3316,7 +3317,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"