Skip to content

Actually fix the CopyToAsync this time #24609

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

Merged
merged 2 commits into from
Aug 6, 2020
Merged

Conversation

davidfowl
Copy link
Member

  • Hard code the 4K buffer length for CopyToAsync
  • Write a test this time :D

Fixes #24032

- Hard code the 4K buffer length for CopyToAsync
- Write a test this time :D
- Made tests less bad
Copy link
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch @Tratcher.

{
public int NumberOfWrites { get; set; }

public override void Write(byte[] buffer, int offset, int count)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should just derive from stream and write to a MemoryStream member. Then you won't have to worry about this breaking because base.Write() someday starts calling Write(ReadOnlySpan) or something like that.

@BrennanConroy BrennanConroy added this to the 5.0.0-rc1 milestone Aug 6, 2020
@davidfowl davidfowl merged commit ed5034e into master Aug 6, 2020
@davidfowl davidfowl deleted the davidfowl/fix-copytoasync branch August 6, 2020 04:11
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FileBufferingReadStream CopyToAsync Performance problem.
5 participants