Message-Id: <200409300242.i8U2gbZO003154@delorie.com> 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 From: "Gary R. Van Sickle" To: Subject: RE: cp to flash drive very slow Date: Wed, 29 Sep 2004 21:42:14 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: 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/