[BusyBox] further ash size reduction

Manuel Novoa III mjn3 at busybox.net
Fri Aug 10 03:48:31 UTC 2001


vodz,

On Fri, Aug 10, 2001 at 01:19:03PM +0400, Vladimir N. Oleynik wrote:
> > For minimal size, your patch sure seems to be the best solution.
> > 
> > In your demonstration patch, you use the function only when
> > ASH_OPTIMIZE_FOR_SIZE is defined.  Do you think it is worth keeping
> > the table implementation at all?  I wonder how much impact the function
> > call per char verses the indirect table lookup has on interpretation speed.
> 
> I think very strongly influences:
> 
> syntax_code[input_char] vs 
> function_call+strchr(spec_symbols, input_char)+syntax_code[index_calculated]
> 
> last do approximately equivalent, size gain in size table
Hmm.  I had just finished incorporating your function into my working file
and making a diff.  I also commented some of my more cryptic code connected
with cmdtxt(), calcsize(), and copynode() and reworked them so they won't
(shouldn't ?) break on 64 bit machines because the struct member offsets
would be too large.  I still want to look at the tokendlist stuff and
compare implementations.

But, now for some real good news...

I was looking at Aaron's patch for ADDCMD and it occured to me that the
setmode() and getmode() functions were only called by umaskcmd() and
that the libbb parse_mode() function did everything that was needed.
So, a couple of lines removed, a couple of lines added, a BIG block of
code removed and... presto... more than 2k smaller.  ;-)  Diff is attached.

> > > Where still it is so much get time... It seems soon me will fire. ;-)
> > 
> > Sorry?  That didn't translate.
> 
> Aaron it has true decoded. ;-)

Ah...  ;-)

Manuel





More information about the busybox mailing list