[BusyBox] further ash size reduction
Vladimir N. Oleynik
dzo at simtreas.ru
Fri Aug 10 03:27:15 UTC 2001
Aaron Lehmann wrote:
> On Thu, Aug 09, 2001 at 11:15:36PM -0600, Manuel Novoa III wrote:
> > Well, you win this round. ;-) There isn't any way to reduce the table
> > implementation to match the function approach, although I was able to
> > reduce it a little by packing 2 4-bit codes of the syntax_index_table into
> > a single unsigned char and then playing games with >> and &.
>
> That can be fun. For your implementation I tried changing basesyntax,
> dqsyntax, etc from tables with 4 of the 8 bits of each entry wasted
> into a 64-bit int with 4 bits for every index. It backfired, partially
> because a lot of shifting and masking is needed since those tables are
> used in many place and also in part because i386 can't natively handle
> such big integers.
Here there are enough 16 bits.
> > As far as your function goes, I was able to trim the size by 7 bytes when
> > compiling just the tables and the one function as extern (to test), but to
> > do it I had to pack each 4-char group in S_I_T into a single unsigned short
> > and then change the return from "return S_I_T[indx][syntax];"
> > to "return (S_I_T[indx] >> syntax) & 0x0f;",
>
> I was thinking of this exact optimization when I first read his patch.
>
> I also like your basesyntax_dqsyntax_sqsyntax_arisyntax #defines more
> than vlad's use of raw numbers. It should be easy for him to fix that,
> though.
And at me opposite opinion. Can I enough comments in the source text am simple
has
not added? There transparent indexes, all intercouplings very simply are traced
and
vary literally in one place.
> I think some profiling would be useful. I don't like excessive use of
> tables but I'm a bit reluctant to replace them with sequential
> conditionals.
>
> > > Where still it is so much get time... It seems soon me will fire. ;-)
> >
> > Sorry? That didn't translate.
>
> Maybe he means he will be fired from his job if he devotes this much
> time to busybox? ;-)
You are right.
--w
vodz
More information about the busybox
mailing list