delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/30/00:04:06

Message-Id: <200409300242.i8U2gbZO003154@delorie.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
From: "Gary R. Van Sickle" <g DOT r DOT vansickle AT worldnet DOT att DOT net>
To: <cygwin AT cygwin DOT com>
Subject: RE: cp to flash drive very slow
Date: Wed, 29 Sep 2004 21:42:14 -0500
MIME-Version: 1.0
In-Reply-To: <Pine.WNT.4.50.0409291056240.684-200000@Thor>
X-IsSubscribed: yes

> I tried using cp to copy a zip file 106MB from my hard drive 
> to my flash drive (sandisk mini cruzer).  After 20 minutes it 
> still had not completed.
> 
> xcopy copied the file in 22 seconds.
> 
> Why would cp be so much slower?  Any ideas as to work-arounds?
> 

Last I checked, cp was slower on network copies than xcopy was, but the
difference was nowhere *near* that dramatic.  I can offer a few guesses
here:

1.  Again last I looked, cp was using fopen()/fread() et al to do the copy.
Good for portability, bad for efficiency.  Xcopy is probably using
CopyFile{Ex} or some such lower-level funcion, which if MS is on the ball
(yeah I know) involves a lot fewer layers of code, and if we're really good
maybe is even copying raw sectors using scatter/gather (yeah I know I'm
dreaming, but maybe).

2.  Caching.  Xcopy may be caching your writes to flash, cp may be forcing a
flush somehow.  I've had similar copies take essentially no time, only to
find out that the copy never actually got committed to disk until much much
later.  XP SP1 doesn't default to that behavior IIRC, but check to make sure
that you do NOT have that option turned on, or you WILL lose data.

Regardless, <3.7Mb/second seems like something's wrong somewhere.  Are you
running USB2.0 hub-to-device?

-- 
Gary R. Van Sickle
 




--
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