alphaleonis / AlphaFS

AlphaFS is a .NET library providing more complete Win32 file system functionality to the .NET platform than the standard System.IO classes.
http://alphafs.alphaleonis.com/
MIT License
558 stars 99 forks source link

Performance Issue #514

Open alex6dj opened 5 years ago

alex6dj commented 5 years ago

Hi, I´m using this for some admin task noticed some strange behaviours...

First: I´m using VS Enterprise 15.9.7 AlphaFS 2.2.6 (nuget)

This was tested in WPF, Console app and Net Standard, all the same behaviour.

The problem is about:

const CopyOptions options = CopyOptions.Restartable; File.Copy(origin, destination, options, null, null, PathFormat.FullPath);

When origin is local the copy run fast, but when origin is a network share it drops from 84 MB/s to only 4 MB/s. This only happens with CopyOptions.Restartable set, with other options or none it works ok. Another tip the 4 MB/s speed is in destination disk, but reads stay at around 25 MB/s (strange).

Sorry my english. By the way excelent library

Yomodo commented 5 years ago

Yes, using CopyOptions.Restartable can slow down the copy progress, at stated by Microsoft:

COPY_FILE_RESTARTABLE 0x00000002 Progress of the copy is tracked in the target file in case the copy fails. The failed copy can be restarted at a later time by specifying the same values for lpExistingFileName and lpNewFileName as those used in the call that failed. This can significantly slow down the copy operation as the new file may be flushed multiple times during the copy operation.

alex6dj commented 5 years ago

Yes I'm aware of that, but is strange that a copy of the same file to a common disk runs at 80 MB/s from another local disk disk but at only 4 MB/s from a remote folder share (1 GB/s network).

Is any other way I can start a copy, pause it and restart from the last point. This is the thing I'm planning to use.