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

Rich Felker dalias at aerifal.cx
Thu Apr 27 14:19:43 UTC 2006


On Thu, Apr 27, 2006 at 11:31:13AM +0300, Denis Vlasenko wrote:
> 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:

This is probably a good patch to apply, but I wonder why write() is
used here instead of fwrite() anyway..? It seems like having applets
use the common buffering system of stdio would be able to cut down on
size in several applets, and possibly improve speed too.

Rich




More information about the busybox mailing list