[BusyBox] gunzip cleanup
Glenn McGrath
bug1 at optushome.com.au
Sun Mar 11 01:41:08 UTC 2001
Busybox with nothing defined
-rwxr-xr-x 1 root bug1 5820 Mar 11 12:03 busybox
text data bss dec hex filename
4015 340 40 4395 112b busybox
With current gunzip defined
-rwxr-xr-x 1 root bug1 16828 Mar 11 12:02 busybox
text data bss dec hex filename
14512 828 1204 16544 40a0 busybox
With my gunzip modified code
-rwxr-xr-x 1 root bug1 14500 Mar 11 12:01 busybox
text data bss dec hex filename
12194 840 88 13122 3342 busybox
So the current gunzip adds 11008B, new modified gunzip 8680B, and the
new code reduces bss size.
Some changes include
- Use stream buffered input rather than internal buffering on low level
input.
- Use getopt.
- Remove nearly all remaining defines.
- Independed from gzip.c (some functions will need to be moved to
gzip.c
- FILE *gz_open(FILE *compressed_file) function (base on code from bb
tar -z initialisation)
Some preliminary speed tests indicate it may be upto 10% slower, but im
getting some inconsistent numbers.. so ill have to do more tests on that
and try and tweak it.
I did start cleaning up gzip.c as well, reduced the source code from
100kB to about 60kB, the existing code is really messy, but ive stuffed
it up and doesnt work now..... damnit :(
Anyway, the gunzip code is looking ok, probably still some minor things
to fix up, i will wait till the dust settles post 0.50 before thinking
about commiting, untill then if anyone wants a look let me know.
Glenn
More information about the busybox
mailing list