Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Feb 2010 17:17:37 -0800
From:      Tim Kientzle <kientzle@freebsd.org>
To:        Juergen Lock <nox@jelal.kn-bremen.de>
Cc:        freebsd-hackers@freebsd.org, Duane.Hesser@gmail.com
Subject:   Re: "tar tfv /dev/cd0" speedup patch
Message-ID:  <4B81DB31.70201@freebsd.org>
In-Reply-To: <20100220103329.GA35467@triton8.kn-bremen.de>
References:  <20100217215940.GA19713@triton8.kn-bremen.de> <20100219181247.GA35702@triton8.kn-bremen.de> <4B7F711E.6040402@freebsd.org> <201002200100.48161.jkim@FreeBSD.org> <20100220103329.GA35467@triton8.kn-bremen.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Juergen,

Could you try the current version of read_open_filename from:

http://libarchive.googlecode.com/svn/trunk/libarchive/archive_read_open_filename.c

You should be able to just copy it into your FreeBSD source
tree and recompile.

Duane Hesser's comments clarified for me that disk and tape
I/O do require fundamentally different strategies, so I
refactored this code to clearly break out those
strategies.  This in turn allowed me to do some
straightforward I/O optimization of the disk case,
which sped up your example by about 100x.  I have a 2G
DVD here on which "tar tvf /dev/acd0" took 90s originally,
takes 14s with your patch, and now takes only 0.6s.
For comparison, after mounting the disk, "find /mnt"
takes 1.6s (which drops to .1s after the cache is warmed).
It would be interesting to also compare two ways of
copying all of the files: "tar xvf /dev/acd0"
on an unmounted disk and "cp -R" on a mounted disk.

The non-disk cases are all still handled generically, but
there are now clearly-labeled holes where someone could
add optimized I/O strategies for tapes, sockets, etc.
I've even included a number of TODO comments about
what strategies I think are worth exploring, including
tricks like using MTIO ioctls on tape, mmap() for disk,
and nonblocking I/O for sockets and pipes.  I expect
any one of these is around a dozen lines of code, so
should be within the reach of even fairly junior
developers.

Tim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B81DB31.70201>