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

Non-async FileStream does not use fast path from Stream for Read/WriteAsync #31411

Closed
poizan42 opened this issue Nov 6, 2019 · 1 comment · Fixed by dotnet/coreclr#27737
Closed
Assignees
Milestone

Comments

@poizan42
Copy link
Contributor

poizan42 commented Nov 6, 2019

Stream.ReadAsync has a fast path (through BeginEndReadSync->BeginReadInternal) when Begin/EndRead isn't overriden in a derived class.

However FileStream does override these so the base implementation won't call them. But the FileStream implementation of ReadAsync delegates to the base implementation when the stream is opened non-async, which then won't use the fast path. It seems that FileStream.ReadAsync should just call BeginReadInternal directly in the case it is non-derived non-async, unless I'm missing something.

@poizan42 poizan42 changed the title Non-async FileStream does not use fast path from Stream from Read/WriteAsync Non-async FileStream does not use fast path from Stream for Read/WriteAsync Nov 6, 2019
@stephentoub
Copy link
Member

Thanks for the suggestion. Addressed in dotnet/coreclr#27737.

@stephentoub stephentoub self-assigned this Nov 7, 2019
@msftgits msftgits transferred this issue from dotnet/corefx Feb 1, 2020
@msftgits msftgits added this to the 5.0 milestone Feb 1, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants