pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/misc mk/misc/show.mk: prevent unnecessary .for loop...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8802f797ef8d
branches:  trunk
changeset: 414658:8802f797ef8d
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Mar 30 22:49:30 2020 +0000

description:
mk/misc/show.mk: prevent unnecessary .for loop expansion

The .for loops are expanded by bmake as soon as they are parsed. Since
there are many variable groups, and since each of these groups has
several variables, this takes quite a bit of time.

The time for running "bmake clean" in pkgtools/pkglint went down from 1.0
second to 0.7 seconds. This may not seem much, but when multiplied with
23088 times 9, this little change may speed up a full bulk build by 62000
seconds, which is about 18 hours.

The side-effect is that the show-all-* targets can only be run from the
command line, not as a dependency of other targets. This restriction will
probably go unnoticed.

diffstat:

 mk/misc/show.mk |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 3d01b2ae11a7 -r 8802f797ef8d mk/misc/show.mk
--- a/mk/misc/show.mk   Mon Mar 30 22:44:26 2020 +0000
+++ b/mk/misc/show.mk   Mon Mar 30 22:49:30 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: show.mk,v 1.19 2020/03/20 16:39:03 rillig Exp $
+# $NetBSD: show.mk,v 1.20 2020/03/30 22:49:30 rillig Exp $
 #
 # This file contains some targets that print information gathered from
 # variables. They do not modify any variables.
@@ -153,7 +153,7 @@
 _LABEL._DEF_VARS=      def
 
 show-all: .PHONY
-.for g in ${_VARGROUPS:O:u}
+.for g in ${"${.TARGETS:Mshow-all*}":?${_VARGROUPS:O:u}:}
 
 show-all: show-all-${g}
 



Home | Main Index | Thread Index | Old Index