[PATCH 2/2] (g)unzip: Optimize inflate_codes()

Joakim Tjernlund joakim.tjernlund at transmode.se
Mon Feb 8 22:04:40 UTC 2010


>
> Joakim Tjernlund/Transmode wrote on 2010/02/08 22:52:11:
> >
> > Rob Landley <rob at landley.net> wrote on 2010/02/08 21:26:44:
> > >
> > > On Monday 08 February 2010 11:55:16 Joakim Tjernlund wrote:
> > > > Ported the recent optimization from the Linux kernel.
> > > > This will not perform as god as the kernel version as the
> > > > code structure in busybox is different and I had to adopt
> > > > the optimization to it.
> > > >
> > > > This has seen very little testing and is a RFC only at this point.
> > > > The inflate speed increase in the kernel was 12-15% on ppc.
> > > >
> > > > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund at transmode.se>
> > >
> > > That looks like a fairly significant size increase.  Is it big enough to
> > > justify a config option?  (This is why "make bloatcheck" exists...)
> >
> > function                                             old     new   delta
> > inflate_codes                                        624     819    +195
> > .rodata                                           131741  131755     +14
> > ------------------------------------------------------------------------------
> > (add/remove: 0/0 grow/shrink: 2/0 up/down: 209/0)             Total: 209 bytes
> >    text    data     bss     dec     hex filename
> >  705967    2137    9072  717176   af178 busybox_old
> >  706176    2137    9072  717385   af249 busybox_unstripped
>
> Left some debug in, the correct bloatcheck is:
> function                                             old     new   delta
> inflate_codes                                        624     791    +167
> ------------------------------------------------------------------------------
> (add/remove: 0/0 grow/shrink: 1/0 up/down: 167/0)             Total: 167 bytes
>    text      data       bss       dec       hex   filename
>  705967      2137      9072    717176     af178   busybox_old
>  706134      2137      9072    717343     af21f   busybox_unstripped

And yet some:
function                                             old     new   delta
inflate_codes                                        624     728    +104
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 104/0)             Total: 104 bytes
   text	   data	    bss	    dec	    hex	filename
 705967	   2137	   9072	 717176	  af178	busybox_old
 706071	   2137	   9072	 717280	  af1e0	busybox_unstripped

I don't think this should be a config option considering the increased risk
of bugs with two variants. Inflate bugs can be pretty serious to your data.

   Jocke



More information about the busybox mailing list