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

Use PreallocatedOverlapped when internal FileStream buffer isn't being used on Windows #25074

Closed
davidfowl opened this issue Feb 17, 2018 · 1 comment · Fixed by #51363
Closed
Assignees
Labels
area-System.IO enhancement Product code improvement that does NOT require public API changes/additions tenet-performance Performance related issue
Milestone

Comments

@davidfowl
Copy link
Member

See comment here dotnet/coreclr#16190 (comment)

/cc @stephentoub

@stephentoub
Copy link
Member

Thanks, @davidfowl.

Am I correct in remembering that the FileStreams ASP.NET cares most about for performance are created with a buffer size of 1 in order to avoid having an internal buffer? If so, I think we should do (3) from my linked comment, simply special-casing buffer size of 1 as the common way of avoiding the buffer, and just changing FileStream's GetBuffer to use Array.Empty and initialize the preallocated. Then we can again allow a null array coming from Memory usage to use the preallocated overlapped.

cc: @JeremyKuhne

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@adamsitnik adamsitnik self-assigned this Apr 16, 2021
@adamsitnik adamsitnik modified the milestones: Future, 6.0.0 Apr 16, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Apr 16, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Apr 16, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.IO enhancement Product code improvement that does NOT require public API changes/additions tenet-performance Performance related issue
Projects
None yet
4 participants