« Tour of the Vegas SuperNAP Data Center | Main | Architecting for the cloud = good architecting »
Tuesday
Jun162009

Fastest method of copying files in Windows?

This question popped up in the community wiki over on ServerFault, so I decided to take a crack at it.

From a performance standpoint only, xcopy or robocopy will give you similar results. I ran through a couple of tests on a Vista 64bit sp2 box to do some comparisons. All copies were performed between a internal 7200 RPM Sata II disk and an external USB 2.0 drive or on the same internal drive itself where indicated. No special setup was done (make up your own mind if that invalidates/validates the test), only to input the command into a batch file to execute. Powershell was used to capture the start and stop times. After a couple of passes here are the averages from the tools I played with:

File: 732,909,568bytes (698MB) 1 ISO file copied to different dir on same internal disk

copy     6secs  (ex. copy G:\folder1\* G:\folder2\)
xcopy    6secs  (ex. xcopy G:\folder1 G:\folder2 /I /E /Y /R)
robocopy 6secs  (ex. robocopy G:\folder1\ G:\folder2 /E /NP)
teracopy 28secs (ex. TeraCopy.exe Copy G:\folder1\ G:\folder2\)
fastcopy 19secs (ex. fastcopy.exe /auto_close G:\folder1 /to=G:\folder2)

File: 732,909,568bytes (698MB) 1 ISO file copied to external usb disk

copy     36secs (ex. copy G:\folder1\* I:\folder2\)
xcopy    35secs (ex. xcopy G:\folder1 I:\folder2 /I /E /Y /R)
robocopy 36secs (ex. robocopy G:\folder1\ I:\folder2 /E /NP)
teracopy 36secs (ex. TeraCopy.exe Copy G:\folder1\ I:\folder2\)
fastcopy 38secs (ex. fastcopy.exe /auto_close G:\folder1 /to=I:\folder2)

Files: 45,039,616bytes (42.9MB) 5 random files copied to external usb disk

copy     6secs  (ex. copy G:\folder1\* I:\folder2\)
xcopy    5secs  (ex. xcopy G:\folder1 I:\folder2 /I /E /Y /R)
robocopy 6secs  (ex. robocopy G:\folder1\ I:\folder2 /E /NP)
teracopy 12secs (ex. TeraCopy.exe Copy G:\folder1\ I:\folder2\)
fastcopy 6secs  (ex. fastcopy.exe /auto_close G:\folder1 /to=I:\folder2)

Files/Dirs: 1,087,180,800bytes (1.01GB) 27 Files/8 Dirs copied to external usb disk

copy     *Not included in test
xcopy    57secs (ex. xcopy G:\folder1 I:\folder2 /I /E /Y /R)
robocopy 58secs (ex. robocopy G:\folder1\ I:\folder2 /E /NP)
teracopy 56secs (ex. TeraCopy.exe Copy G:\folder1\ I:\folder2\)
fastcopy 60secs (ex. fastcopy.exe /auto_close G:\folder1 /to=I:\folder2)

This is by no means an exhaustive test, but just throwing a quick real world scenario at some of the more popular tools in this genre shows that your pretty safe sticking with either xcopy or robocopy (from a performance standpoint only). Also the robocopy option /NP No Progress saves you 0 time. That doesn't mean you cannot benefit from using something other than xcopy however. RoboCopy is a great example (from Wikipedia):

Robocopy is notable for capabilities above and beyond the built-in Windows copy and
xcopy commands, including the following:

  • Ability to tolerate network outages and resume copying where it previously left off (incomplete files are noted with a date stamp corresponding to 1980-01-01 and contain a recovery record so Robocopy knows from where to continue).
  • Ability to correctly copy attributes, owner information, alternate data streams, auditing information, and timestamps by default, without the need for numerous often forgotten command line switches.
  • Ability to correctly copy NTFS ACLs, (when /COPYALL provided), and to assert the Windows NT "backup right" (/B) so an administrator may copy an entire directory, including files denied readability to the administrator.
  • Persistence by default, with a programmable number of automatic retries if a file cannot be opened.
  • A "mirror" mode, which keeps trees in sync by optionally deleting files out of the destination that are no longer present in the source.
  • Ability to copy large numbers of files that would otherwise crash the built-in XCOPY utility.
  • A progress indicator on the command line that updates continuously.
  • Ability to copy long file and folder names exceeding 256 characters — up to a theoretical 32,000 characters — without errors.

PrintView Printer Friendly Version

EmailEmail Article to Friend

References (1)

References allow you to track sources for this article, as well as articles that were written in response to this article.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.