[BusyBox] My cleaned up bunzip.

Rob Landley rob at landley.net
Wed Oct 15 09:27:43 UTC 2003


On Tuesday 14 October 2003 22:57, Erik Andersen wrote:
> On Tue Oct 14, 2003 at 08:57:37PM -0500, Rob Landley wrote:
> > jseward says that the CRC algorithm is "AUTODIN", which is the one used
> > for ethernet, which is basically a big endian version of the the same
> > basic crc algorithm in gzip.  Alexander van Heukelum emailed me a three
> > line implementation from a CRC FAQ that matches, and I cleaned it up a
> > bit.  Cut another 100 lines off the source, and then out of sheer vanity
> > I removed some blank lines around comments (and added a few more
> > comments).  New total: 453 lines, which compiles to a 6504 byte
> > executable (when stripped).
> >
> :-)
> :
> > It's still a little over 3 seconds slower extracting the 2.6.0-test6
> > kernel tarball (81.5 seconds vs 78 seconds for the old one on my laptop),
> > but oh well.  I'm tired.  Ship it.
>
> I must say you've done a fine job.  Very very cool!
>
>  -Erik

Thanks. :)

Glenn and I are ping-pinging back and forth on changing it to make tar happy.  
My new code only reads from one fd and writes to another, and the tar code 
wants to request the next X bytes of output.  Tar could fork and read from a 
pipe (which would allow it to use external compressors, too), or I could hack 
my code to add a "gimme the next X bytes" call.

I'm working on the second.  I've finished implementing it (still debugging, it 
doesn't actually WORK yet), but it added 320 bytes... :(

Then again, something else I did may actually speed up the fast path and gimme 
those 3 seconds back, and if so I'd consider it a good tradeoff, 
personally...

Debugging it will have to wait until tomorrow, though.  I haven't actually 
gotten any sleep since "I'm tired", above, and am now starting to pass out...

Rob

(I know I've got the bit between my teeth on this, but in the past 72 hours I 
believe I've gotten a total of around 7 hours of sleep.  I MEANT to go get 
some sleep eight hours ago... :)



More information about the busybox mailing list