Skip to content

Adapt InternalUploadFile for async #1653

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Rob-Hague
Copy link
Collaborator

The recently added UploadFileAsync effectively calls stream.CopyToAsync(SftpFileStream). This is slower than the sync UploadFile (by about 4x in a local test) because the sync version sends multiple write requests concurrently, without waiting for each response in turn like the stream-based version does.

This change adapts the sync code for async and uses it to bring the performance of UploadFileAsync in line with that of UploadFile.

The recently added UploadFileAsync effectively calls stream.CopyToAsync(SftpFileStream).
This is slower than the sync UploadFile (by about 4x in a local test) because the sync
version sends multiple write requests concurrently, without waiting for each response
in turn like the stream-based version does.

This change adapts the sync code for async and uses it to bring the performance of
UploadFileAsync in line with that of UploadFile.
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

Successfully merging this pull request may close these issues.

1 participant