This is the mail archive of the
mailing list for the Cygwin project.
Re: Sparse file performance
- From: "Pierre A. Humblet" <Pierre dot Humblet at ieee dot org>
- To: cygwin at cygwin dot com, rcampbell at tropicnetworks dot com
- Date: Fri, 06 Jun 2003 09:18:53 -0400
- Subject: Re: Sparse file performance
Rolf Campbell wrote:
> I created a 3Meg, 6Meg, 10Meg and 40Meg file using cp /dev/zero.
> I then copied each file using windows explorer (and then verified
> that the sparse bit was gone).
> Then I ran 'time cat filename > /dev/null' (i ran it a few times
> to make sure the file was cached). The performance difference was:
> 40Meg: 5%
> 10Meg: 7%
> 6Meg: 10%
> 3Meg: 5%
> This wasn't the most sofisticated test ever, I did not ensure that
> the files were equally fragmented on disk. But, it does show that
> sparse files are notably slower.
to remove the possible biases you allude to, could you start from
an existing file, time it, then change it (in place) to a sparse
file and re-execute the timing test?
The way to change the file to sparse follows (untested, I don't have
access to sparse files today)
HANDLE handle = CreateFile(name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
(returns INVALID_HANDLE_VALUE on error)
BOOL r = DeviceIoControl ( handle , FSCTL_SET_SPARSE,
NULL, 0, NULL, 0, &dw, NULL);
(returns 0 on error)
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html