pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/pbulk mk: Improve pbulk-index performance.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3652cec47556
branches:  trunk
changeset: 388580:3652cec47556
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Wed Nov 23 10:22:40 2022 +0000

description:
mk: Improve pbulk-index performance.

Avoid forking a new shell for every 'echo' command, and use bmake loop
expansion to handle MULTI_VERSION section by a single shell.

Reduces the number of shells invoked during the scan phase by over
200,000, reducing system time and speeding up scan times.

diffstat:

 mk/pbulk/pbulk-index.mk |  40 ++++++++++++++++++++++------------------
 1 files changed, 22 insertions(+), 18 deletions(-)

diffs (55 lines):

diff -r 041e0caeaf03 -r 3652cec47556 mk/pbulk/pbulk-index.mk
--- a/mk/pbulk/pbulk-index.mk   Wed Nov 23 10:16:44 2022 +0000
+++ b/mk/pbulk/pbulk-index.mk   Wed Nov 23 10:22:40 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: pbulk-index.mk,v 1.26 2022/04/25 10:59:23 jperkin Exp $
+#      $NetBSD: pbulk-index.mk,v 1.27 2022/11/23 10:22:40 jperkin Exp $
 
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to the parallel bulk build
@@ -112,24 +112,28 @@
 .endif
 
 pbulk-index-item:
-       @echo "PKGNAME="${PKGNAME:Q}
-       @echo "ALL_DEPENDS="${_ALL_DEPENDS:Q}
-       @echo "PKG_SKIP_REASON="${PKG_SKIP_REASON:Q}
-       @echo "PKG_FAIL_REASON="${PKG_FAIL_REASON:Q}
-       @echo "NO_BIN_ON_FTP="${NO_BIN_ON_FTP:Q}
-       @echo "RESTRICTED="${RESTRICTED:Q}
-       @echo "CATEGORIES="${CATEGORIES:Q}
-       @echo "MAINTAINER="${MAINTAINER:Q}
-       @echo "USE_DESTDIR="${_USE_DESTDIR:Q}
-       @echo "BOOTSTRAP_PKG="${BOOTSTRAP_PKG}
-       @echo "USERGROUP_PHASE="${USERGROUP_PHASE:Q}
-       @echo "SCAN_DEPENDS="${_PBULK_SCAN_DEPENDS:O:u:Q}
+       ${RUN} { \
+               echo "PKGNAME="${PKGNAME:Q}; \
+               echo "ALL_DEPENDS="${_ALL_DEPENDS:Q}; \
+               echo "PKG_SKIP_REASON="${PKG_SKIP_REASON:Q}; \
+               echo "PKG_FAIL_REASON="${PKG_FAIL_REASON:Q}; \
+               echo "NO_BIN_ON_FTP="${NO_BIN_ON_FTP:Q}; \
+               echo "RESTRICTED="${RESTRICTED:Q}; \
+               echo "CATEGORIES="${CATEGORIES:Q}; \
+               echo "MAINTAINER="${MAINTAINER:Q}; \
+               echo "USE_DESTDIR="${_USE_DESTDIR:Q}; \
+               echo "BOOTSTRAP_PKG="${BOOTSTRAP_PKG}; \
+               echo "USERGROUP_PHASE="${USERGROUP_PHASE:Q}; \
+               echo "SCAN_DEPENDS="${_PBULK_SCAN_DEPENDS:O:u:Q}; \
+       }
 .if defined(_PBULK_MULTI_NEEDED)
-       @printf "MULTI_VERSION="
-.for _t in ${_PBULK_MULTI_NEEDED}
-       @printf " %s=%s" ${_PBULK_MULTI_VAR.${_t}:Q} ${_PBULK_MULTI_VALUE_${_t}:Q}
-.endfor
-       @printf "\n"
+       ${RUN} { \
+               printf "MULTI_VERSION="; \
+               ${_PBULK_MULTI_NEEDED:@_t@ \
+                       printf " %s=%s" ${_PBULK_MULTI_VAR.${_t}:Q} ${_PBULK_MULTI_VALUE_${_t}:Q}; \
+               @} \
+               printf "\n"; \
+       }
 .endif
 
 pbulk-save-wrkdir:



Home | Main Index | Thread Index | Old Index