-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RoboCopy Benchmarking #192
Comments
Net5.0 TestsNote : to reiterate, each result set is an average of 10 copy operations using the same source/destination. The RoboCommand had default settings generated by the library. USB 2.0 Copy Operation: (only ran this once as the USB i was using took like an hour to do this test)
USB 3.0 Copy Operation
Same Drive Copy Operation:
Network Drive ( For reference, windows copy averaged 50-60MB/s copying this file when dragged-and-dropped from the network to the C:\ drive )
Conclusions:
If progress reporting and cancellation is not required, Task.Run(() => File.Copy()) will yield best results. This is somewhat expected as this runs the copy operating consuming a thread on its own the entire time, just as a background worker. If cancellation is required, without progress reporting, CopyFileEx or the FileStream.CopyToAsync() works well. If async and progress reporting is required, CopyFileEx is fantastic. RoboCopy is good enough though. Im curious what Microsoft uses in their drag and drop dialogue to report copy progress. |
When I was programming in windows 7 days, this was the |
As far as I can, tell that entire functions that has been deprecated with the release of Windows Vista. I was using CopyFileEx because it has been reported since Windows XP and they were keeping it current, with even a new feature being added for windows, which was SMB compression. |
I'm currently writing a custom IRoboCommand to orchestrate building a complex file batch that pulls from various folders and singular files to a final destination. As such, I've written an interface that has a method for CopyToAsync() to copy a file from source to destination asynchronously. I'm creating this thread to document some benchmarks, as RoboCopy is great at what it does.
I used ChatGPT and the microsoft documentation to create some async methods to handle the copying that reports via an
IProgress<long>
object. As well as a project developed to use CopyFileEx to perform the copy operation.The benchmark for these tests was run in a console app in release mode, using a 334MB file. Each copy operation was performed 10x and the time report was the average result. My goal was to determine if a comparable time-to-copy could be achieve for a single file that falls within the current documentation recommendations I've been able to track down over a few days.
Note : This test was done on a console application targeting Net5.0 (as my work computer does not have VS2022 yet). Net6.0 benchmarks will happen in a followup comment.
CopyFileEx : https://github.com/RFBCodeWorks/CachedRoboCopy/blob/master/CachedRoboCopy/FileCopier.cs
The text was updated successfully, but these errors were encountered: