[PATCH] speed up tar (twice as fast, +64 bytes of code)

Denis Vlasenko vda at ilport.com.ua
Thu Apr 27 08:31:13 UTC 2006


Speed up tar by stop padding blocks with
for (...TAR_BLOCK_SIZE...) write(fd, "\0", 1);

Tarring up bbox build tree.
90% of all syscalls are 1 byte writes:

# (strace ./busybox_org_tar tar cf - . >/dev/null) 2>&1 | wc -l
620174
# (strace ./busybox_new_tar tar cf - . >/dev/null) 2>&1 | wc -l
53919

# time sh -c 'for a in `seq 1 50`; do ./busybox_org_tar tar cvf - . >/dev/null 2>&1; done'
real    0m38.941s
user    0m11.125s
sys     0m21.289s
# time sh -c 'for a in `seq 1 50`; do ./busybox_new_tar tar cvf - . >/dev/null 2>&1; done'
real    0m19.530s
user    0m5.088s
sys     0m10.953s

# size busybox_org_tar busybox_new_tar
   text    data     bss     dec     hex filename
 750700   10728 1195232 1956660  1ddb34 busybox.org1.t/busybox
 750764   10728 1195776 1957268  1ddd94 busybox.tar_coalesce_writes.t/busybox

Please apply
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tar_coalesce_writes_2.patch
Type: text/x-diff
Size: 2504 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060427/2f74f41e/attachment.bin 


More information about the busybox mailing list