From owner-freebsd-current@FreeBSD.ORG Fri Nov 21 18:35:44 2003 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 2141316A4CE for ; Fri, 21 Nov 2003 18:35:44 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6858143F85 for ; Fri, 21 Nov 2003 18:35:42 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id NAA06601; Sat, 22 Nov 2003 13:35:26 +1100 Date: Sat, 22 Nov 2003 13:35:26 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Tim Kientzle In-Reply-To: <3FBEA6ED.1020200@acm.org> Message-ID: <20031122130239.S3300@gamplex.bde.org> References: <200311182307.hAIN7Wpm000717@dyson.jdyson.com> <20031119142535.GA27610@electra.cse.Buffalo.EDU> <20031120061110.P8759@gamplex.bde.org> <3FBEA6ED.1020200@acm.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Ken Smith cc: freebsd-current@freebsd.org cc: Marcel Moolenaar Subject: Re: Unfortunate dynamic linking for everything 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: Sat, 22 Nov 2003 02:35:44 -0000 On Fri, 21 Nov 2003, Tim Kientzle wrote: > Bruce Evans wrote: > > It obviously uses NSS. How else could it be so bloated? : > > > > $ ls -l /sbin/init > > -r-x------ 1 root wheel 453348 Nov 18 10:30 /sbin/init > > I believe it's actually DNS, not NSS. > > Pre-5.0, the resolver ballooned significantly. > A lot of the bloat in /bin and /sbin came > from the NIS functions which in turn pull in > the resolver. Perhaps both. > Example: /bin/date on 5.1 is also over 450k > because of a single call to getservbyname(). > Removing that one call shrinks a static /bin/date > to a quite reasonable size. (I seem to recall 80k when > I did this experiment.) The 2 calls to logwtmp() must also be removed, at least now. I get the following text sizes: for /bin/date: RELENG_4: 137491 -current*: 93214 (* = getservbyname() and logwtmp() calls removed) -current: 371226 (only 412492 total, not 450K yet) > I note that /sbin/init calls getpwnam(); > I expect that's where the bloat gets pulled in. Yes, except it's only the latest 200+K of bloat (from 413558 bytes text to 633390). Before that there was 100+K of miscellaneous bloat relative to RELENG_4 (text size 305289 there). Before that there was another 200+K of bloat from implementing history. Compiling with -DNO_HISTORY removes history support and reduces the text size to 162538 (this is without getpwnam()). Then there is another 30K of mostly non-bloat for actual changes within /bin/sh, since compiling the FreeBSD-1 /bin/sh with current libraries gives a text size of 132966. Finally, IIRC the text size of the FReeeBSD-1 /bin/sh is 70K (total size 90K), so there is another 60K of miscellaneous bloat in current libraries to increase the text size from 70K to 130K. Total text sizes for /bin/sh's internals: FreeBSD-1 sh compiled with -current's compiler: 55350 current sh compiled with -current's compiler: 87779 87:55 is about right for the increased functionality. Bruce