From owner-cvs-all Sun Jul 21 3:40:35 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B8DBB37B400; Sun, 21 Jul 2002 03:40:27 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 755FB43E42; Sun, 21 Jul 2002 03:40:26 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id UAA32672; Sun, 21 Jul 2002 20:39:53 +1000 Date: Sun, 21 Jul 2002 20:43:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Tim Robbins Cc: cvs-all@FreeBSD.ORG, Subject: Re: cvs commit: src/bin/sh sh.1 In-Reply-To: <20020721180547.A29241@dilbert.robbins.dropbear.id.au> Message-ID: <20020721203021.D19918-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 21 Jul 2002, Tim Robbins wrote: > On Sun, Jul 21, 2002 at 04:40:31PM +1000, Bruce Evans wrote: > > > On Sat, 20 Jul 2002, Tim J. Robbins wrote: > > > > > tjr 2002/07/20 22:50:16 PDT > > > > > > Modified files: (Branch: RELENG_4) > > > bin/sh sh.1 > > > Log: > > > Restore the note about printf(1) being a shell builtin that was lost in the > > > previous MFC. > > > > I'd like to unbreak this in -current too. The bloat of /bin/sh from 90K > > text in FreeBSD-1 to 600K text today has very little to do with it having > > a few small builtins. > > Are you saying you'd like to see printf made a builtin again? The only > problem I have with it being a builtin is that it's not really used often > enough. Yes. It's up to shell script authors how much it is used. It really ought to be used more because echo is so unportable. > FWIW, I can get FreeBSD 4.6's sh's text size down to 126K (entire binary is > 156K) by #define'ing JOBS to 0 in shell.h and adding -DNO_HISTORY (which > also disables line editing) to CFLAGS, and removing the call to getpwnam() > in expand.c. Removing the printf builtin brings the text size down to 122K, > which pretty much confirms what you say about it not contributing to bloat. Right. I have tried removing those things before, and nothing except them has made a very large difference for many years. libedit doesn't seem to be very well engineered (it seems to cause more bloat than libreadline despite being much smaller and doing less), but the getpwnam() bloat is much larger and harder to fix. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message