delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/06/09:17:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3EE094BD.70E8E10D@ieee.org>
Date: Fri, 06 Jun 2003 09:18:53 -0400
From: "Pierre A. Humblet" <Pierre DOT Humblet AT ieee DOT org>
X-Accept-Language: en,pdf
MIME-Version: 1.0
To: cygwin AT cygwin DOT com, rcampbell AT tropicnetworks DOT com
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.

Rolf,

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)

DWORD dw;
HANDLE handle = CreateFile(name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 
	                   FILE_ATTRIBUTE_NORMAL, NULL);
(returns INVALID_HANDLE_VALUE on error)
BOOL r = DeviceIoControl ( handle , FSCTL_SET_SPARSE,
			  NULL, 0, NULL, 0, &dw, NULL); 
(returns 0 on error)


Pierre

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019