I need an algorithm which can copy data(files/folder) from one place to another, faster than windows default copy/paste option. I'm working in vc++. Is there any algorithm by which I can do copy/paste faster.
Or Is there is any other suggestion to perform this task?
Thanks
C++ – Algorithm to Copy data faster than windows default copy provider
algorithmsc
Related Topic
- Design Patterns – Structuring Access Control in Hierarchical Object Graph
- C++ – How to extract the active code path from a complex algorithm
- C# Algorithms – Merging Multiple Rows of Data
- How to Upgrade Codebase to Visual Studio 2017 Painlessly
- Database – Effecient algorithm for data deduplication in procedural code
Best Answer
The Windows copy/paste function has several components.
In my opinion you are unlikely to be able to write code that can beat the Windows CopyFile() API function. You can however use multi-threading to saturate the IO channel and if you also omit the cute GUI stuff and the pre-analysis then that's probably as fast as you can go.
You can test this quite easily by running several XCOPY tasks at the same time and watching the resource monitor to see when you reach the maximum IO throughput.
One final thought: if you're copying a lot of small files there may be advantages in copying files that are located close together to minimise disk head movement. You would need to test to find out whether that is a factor.