[PATCH] store --help messages in compressed form. saves 35k

Manuel Novoa III mjn3 at codepoet.org
Thu Apr 6 20:23:19 UTC 2006


On Thu, Apr 06, 2006 at 01:11:39PM -0500, Rob Landley wrote:
> On Wednesday 05 April 2006 3:36 am, Bernhard Fischer wrote:
> > On Wed, Apr 05, 2006 at 09:57:20AM +0300, Denis Vlasenko wrote:
> > >On Wednesday 05 April 2006 09:41, Denis Vlasenko wrote:
> > >> Subject basically says it all.
> > >>
> > >> Run tested with and without verbose help messages.
> > >
> > >+static const char *unpack_usage_messages(void)
> > >+{
> >
> > []
> >
> > >+		check_header_gzip(input[0]);
> > >+		inflate_gunzip(input[0], output[1]);
> >
> > Why don't you lzma (or bzip2) them?
> 
> Because bzip2 and lzma take way more scratch memory to extract than gzip does?  
> (busybox --help should not need to allocate 4 megs of ram in order to run.)

You don't necessarily need a large amount of ram for lzma decompression.
See for example the patches floating around integrating lzma with cramfs
and squashfs.  Also, I think I recall busybox gzip decompression relying
on 2 staticly allocated buffers totalling about 750K.  Perhaps that's
been fixed.

I have to ask how much of a win is compressing busybox help text?
Certainly in the case of flash use, you're likely already using some
type of compressed filesystem.  Maybe if you're doing XIP...  But then
you're likely tight enough on ram that you wouldn't bother with the
help text.

Manuel



More information about the busybox mailing list