This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: cp to flash drive very slow
- From: "David A. Rogers" <darogers at speakeasy dot net>
- To: cygwin at cygwin dot com
- Date: Thu, 30 Sep 2004 09:53:22 -0500 (Central Daylight Time)
- Subject: RE: cp to flash drive very slow
Thanks for responding, Gary.
> Regardless, <3.7Mb/second seems like something's wrong somewhere. Are you
> running USB2.0 hub-to-device?
I dunno. I'm not very knowledgable about hardware esp. USB. How would I
tell?
dar
On Wed, 29 Sep 2004, Gary R. Van Sickle wrote:
> > 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?
>
>
--
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/