From owner-freebsd-current@FreeBSD.ORG Thu Feb 5 11:09:48 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7811216A4CE for ; Thu, 5 Feb 2004 11:09:48 -0800 (PST) Received: from phantom.cris.net (phantom.cris.net [212.110.130.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5210443D53 for ; Thu, 5 Feb 2004 11:09:27 -0800 (PST) (envelope-from ru@FreeBSD.org.ua) Received: from phantom.cris.net (ru@localhost [127.0.0.1]) by phantom.cris.net (8.12.10/8.12.10) with ESMTP id i15J98oh021537; Thu, 5 Feb 2004 21:09:08 +0200 (EET) (envelope-from ru@FreeBSD.org.ua) Received: (from ru@localhost) by phantom.cris.net (8.12.10/8.12.10/Submit) id i15J96OU021528; Thu, 5 Feb 2004 21:09:06 +0200 (EET) (envelope-from ru) Date: Thu, 5 Feb 2004 21:09:06 +0200 From: Ruslan Ermilov To: Bruce Evans Message-ID: <20040205190906.GD20227@FreeBSD.org.ua> References: <20040205091634.GC13932@FreeBSD.org.ua> <20040206012805.N8113@gamplex.bde.org> <20040205151425.GA18523@FreeBSD.org.ua> <20040206030956.F11456@gamplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XuV1QlJbYrcVoo+x" Content-Disposition: inline In-Reply-To: <20040206030956.F11456@gamplex.bde.org> User-Agent: Mutt/1.5.5.1i cc: current@FreeBSD.org Subject: Re: Very long SRCS list with unusually long src/ prefix X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 19:09:48 -0000 --XuV1QlJbYrcVoo+x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 06, 2004 at 03:19:46AM +1100, Bruce Evans wrote: > On Thu, 5 Feb 2004, Ruslan Ermilov wrote: >=20 > > On Fri, Feb 06, 2004 at 01:40:45AM +1100, Bruce Evans wrote: > > > On Thu, 5 Feb 2004, Ruslan Ermilov wrote: > > [...] > > > % +.for f in ${DPSRCS:M*.[cS]} ${DPSRCS:M*.cc} ${DPSRCS:M*.C} ${DPSRC= S:M*.cpp} \ > > > % + ${DPSRCS:M*.cxx} ${DPSRCS:M*.m} > > > % +_mkdep_${f}: ${f} > > > % + @echo ${.ALLSRC} > > > % +.endfor > > > > > > This seems to run echo once for each file separately. It should be d= eemed > > > inefficient :-). > > > > > But that's what this patch basically does: it splits possibly very > > long ${.ALLSRC} list into pieces. It's very inefficient only in > > traditional mode. Run this with and without -j1 to see the diff: > > > > : COUNT!=3D jot 1000 > > : > > : all: > > : .for foo in ${COUNT} > > : @echo $$$$ >/dev/null > > : .endfor >=20 > That is slow too. I get 12.12 seconds with make, 2.36 with make -j1, > 1.37 with a shell loop and bash-1, 1.35 with a shell loop and /bin/sh, > and 0.0042 with jot 1000 >/dev/null. >=20 Shell loops aren't an option here. I realize that we loose speed here, but we gain a feature. > I wonder about all those little dependencies too. make already takes > a noticeable amount of time to handle large subdirs (here it takes 0.48 > seconds for a null "make depend"). >=20 I see the 0.18 secs increase for "make depend" in bin/cat. I see no increase when .depend is not stale (since this code is not run then). What do you mean by a ``null "make depend"''? > > > % ${DEPENDFILE}: ${DPSRCS} > > > % rm -f ${DEPENDFILE} > > > % .if !empty(DPSRCS:M*.[cS]) > > > % - ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ > > > % - ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*} \ > > > % - ${.ALLSRC:M*.[cS]} > > > % + (cd ${.CURDIR}; ${MAKE} _mkdep_cS) | xargs env \ > > > % + ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ > > > % + ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*} > > > > > > make uses a real shell, so the env shouldn't be needed. > > > > > $ echo foo.c | xargs CC=3Dcc mkdep > > xargs: CC=3Dcc: No such file or directory >=20 > $ echo foo.c | CC=3Dcc xargs mkdep >=20 Yes, but ``grep ^MKDEPCMD bsd.dep.mk'' to see what I'm talking about. Cheers, --=20 Ruslan Ermilov FreeBSD committer ru@FreeBSD.org --XuV1QlJbYrcVoo+x Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAIpTSUkv4P6juNwoRAnsPAJ4jrJhm1X1HOA11UrBuNTCt1HidSgCdFBwI otqorp5EtFAO+FiwDpZQEOc= =zOeb -----END PGP SIGNATURE----- --XuV1QlJbYrcVoo+x--