Skip to content
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

Performance Issue #514

Open
alex6dj opened this issue Mar 2, 2019 · 2 comments
Open

Performance Issue #514

alex6dj opened this issue Mar 2, 2019 · 2 comments

Comments

@alex6dj
Copy link

alex6dj commented Mar 2, 2019

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
Copy link
Collaborator

Yomodo commented Mar 3, 2019

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
Copy link
Author

alex6dj commented Mar 3, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants