Date: Tue, 21 May 1996 20:01:42 +0200 From: Wolfram Schneider <wosch@campa.panke.de> To: Bruce Evans <bde@zeta.org.au> Cc: hackers@freebsd.org Subject: MLINKS (Re: Congrats on CURRENT 5/1 SNAP...) Message-ID: <199605211801.UAA04502@campa.panke.de> In-Reply-To: <199605210808.SAA28887@godzilla.zeta.org.au> References: <199605210808.SAA28887@godzilla.zeta.org.au>
index | next in thread | previous in thread | raw e-mail
Bruce Evans writes:
>about 8ms to exec a small dynamically linked binary and about 2ms to
>exec a small statically linked binary. /bin/sh isn't execed all that
>much (because make is smart enough to exec things directly). However,
>expr and test are execed a lot for the stupid shell scripts for handling
>MLINKS. It takes about 150 seconds longer than it should to create all
>the links for libraries alone. About 50 seconds of this is for unnecessary
>exec overhead and the rest is because too many processes are execed and
>sync metadata updates are too slow.
The following patch reduce the time for `cd /usr/src; make maninstall'
from 1120.89 real 514.68 user 366.11 sys
to 985.58 real 500.02 user 287.07 sys
a dirty perl script need
936.98 real 516.46 user 223.40 sys
and I guess a C-program would need ~885 sec.
Wolfram
--- bsd.man.mk Wed Apr 10 01:10:19 1996
+++ ../mk3/bsd.man.mk Tue May 21 15:55:49 1996
@@ -61,20 +61,18 @@
.endfor
.if defined(MLINKS) && !empty(MLINKS)
- @set ${MLINKS}; \
- while test $$# -ge 2; do \
- name=$$1; \
- shift; \
- sect=`expr $$name : '.*\.\([^.]*\)'`; \
- dir=${DESTDIR}${MANDIR}$$sect; \
- l=$${dir}${MANSUBDIR}/$$name; \
- name=$$1; \
- shift; \
- sect=`expr $$name : '.*\.\([^.]*\)'`; \
- dir=${DESTDIR}${MANDIR}$$sect; \
- t=$${dir}${MANSUBDIR}/$$name; \
+ @set `echo ${MLINKS} " " | sed 's/\.\([^.]*\) /.\1 \1 /g'`; \
+ while : ; do \
+ case $$# in \
+ 0) break;; \
+ [123]) echo "warn: empty MLINK: $$1 $$2 $$3"; break;; \
+ esac; \
+ name=$$1; shift; sect=$$1; shift; \
+ l=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
+ name=$$1; shift; sect=$$1; shift; \
+ t=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \
rm -f $${t} $${t}${ZEXTENSION}; \
ln $${l}${ZEXT} $${t}${ZEXT}; \
- done; true
+ done
.endif
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605211801.UAA04502>
