Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 30 Sep 2004 09:53:22 -0500 (Central Daylight Time) From: "David A. Rogers" To: cygwin AT cygwin DOT com Subject: RE: cp to flash drive very slow Message-ID: X-Warning: UNAuthenticated Sender MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes 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/