From nobody Sat Apr 09 11:08:33 2022 X-Original-To: dev-commits-src-main@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 9255A1800180; Sat, 9 Apr 2022 11:08:35 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KbC6B5h6sz3Qdg; Sat, 9 Apr 2022 11:08:34 +0000 (UTC) (envelope-from ronald-lists@klop.ws) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=klop.ws; s=mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References: To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=iVxZ/P51FvJMjsuivfJpr27yaAKqU6YFDttMwIWPHBI=; b=HS+e10IqjFSZ1Bha8btupCfKsm cBR4x1TMxYteE+2kDz4kFIa5Mg7338rxxSSYEw5mc3ZEgHD14S61RQkZkTmno6azWcE30F/bA7YKc aNctoecTrZCyyLnpq+uFobvQ+lAUMN5Z5bFW9sXlCW4QCiyUbcTRig4giPbX/1ud53Us=; Message-ID: Date: Sat, 9 Apr 2022 13:08:33 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: git: a8267ecc3df0 - main - Speed up *-old-* make targets by using sed instead of xargs Content-Language: en-US To: Ed Maste , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202204090041.2390fIR0079227@gitrepo.freebsd.org> From: Ronald Klop In-Reply-To: <202204090041.2390fIR0079227@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.greenhost.nl X-Spam-Level: ---- X-Spam-Score: -4.0 X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,BAYES_20,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.2 X-Scan-Signature: 2c269fdec788119c0964d98755c55204 X-Rspamd-Queue-Id: 4KbC6B5h6sz3Qdg X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=klop.ws header.s=mail header.b=HS+e10Iq; dmarc=pass (policy=quarantine) header.from=klop.ws; spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates 195.190.28.88 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws X-Spamd-Result: default: False [-3.98 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[klop.ws:s=mail]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:195.190.28.64/27]; NEURAL_HAM_LONG(-1.00)[-1.000]; RWL_MAILSPIKE_EXCELLENT(0.00)[195.190.28.88:from]; DKIM_TRACE(0.00)[klop.ws:+]; DMARC_POLICY_ALLOW(-0.50)[klop.ws,quarantine]; RCVD_IN_DNSWL_NONE(0.00)[195.190.28.88:from]; NEURAL_HAM_SHORT(-0.98)[-0.981]; MLMMJ_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:47172, ipnet:195.190.28.0/24, country:NL]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 4/9/22 02:41, Ed Maste wrote: > 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 > thanks! > 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" >