Date: Sat, 22 Nov 2003 13:35:26 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: Tim Kientzle <kientzle@acm.org> Cc: Marcel Moolenaar <marcel@xcllnt.net> Subject: Re: Unfortunate dynamic linking for everything Message-ID: <20031122130239.S3300@gamplex.bde.org> In-Reply-To: <3FBEA6ED.1020200@acm.org> References: <200311182307.hAIN7Wpm000717@dyson.jdyson.com> <20031119142535.GA27610@electra.cse.Buffalo.EDU> <20031120061110.P8759@gamplex.bde.org> <3FBEA6ED.1020200@acm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031122130239.S3300>