Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jul 2002 20:43:56 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Tim Robbins <tjr@FreeBSD.ORG>
Cc:        cvs-all@FreeBSD.ORG, <cvs-committers@FreeBSD.ORG>
Subject:   Re: cvs commit: src/bin/sh sh.1
Message-ID:  <20020721203021.D19918-100000@gamplex.bde.org>
In-Reply-To: <20020721180547.A29241@dilbert.robbins.dropbear.id.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020721203021.D19918-100000>