superfluous code in gunzip.c?

Rob Landley rob at landley.net
Sat Mar 4 15:52:41 UTC 2006


On Friday 03 March 2006 7:26 pm, David Daney wrote:
> Rob Landley wrote:
> > So having -d accepted but ignored by our gunzip makes some (arguably
> > broken) scripts happy, at the cost of one byte.  No point in adding it to
> > the usage, since it doesn't do anything.
>
> If both programs have exactly the same options, then the getopt flags
> string will (should) be exactly the same.

I said the gnu versions have exactly the same options as each other.  We just 
support a subset.  (Our gzip documents -cdf but also accepts/ignores 1-9, and 
our gunzip documents -cft but also accepts/ignores d.)

> So there may be savings to be had by looking at all getopt specification
> strings for all applets and reordering the contents to see if sharing is
> possible.

If the compiler does this for us automatically, yay.  (And it would pretty 
much have to be binutils, not gcc.)  But it's not quite that simple, our 
config strings vary based on what features you've configured in.

I'm certainly not discouraging this type of micro-optimization (we do it all 
the time), but at the moment there are plenty of low-hanging fruit in the 
tree that would give a bigger bang for the buck.  For example, the current 
fdisk is over 60k and a sane implementation would probably be somewhere 
around 10-20% of that.

Of course if you can come up with specific example patches that shrink the 
tree, one of us will happily apply them. :)

> David Daney

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list