Uh oh!
There was an error while loading. Please reload this page.
Change FileStream to be async by default - #103833
Conversation
neon-sunset
commented
Jun 21, 2024
Please note that this may degrade single-threaded IO performance on Windows (and I don't think it does anything on Unix?). For some reason, going through Overlapped IO performs much worse. Further discussion: https://github.com/Cysharp/Utf8StreamReader?tab=readme-ov-file#optimizing-filestream |
Making this async will cause all synchronous usage to be sync-over-async on Windows. We should not do that. Thanks for the thought, though. |
hez2010
commented
Jun 21, 2024
Can we instead add overloads which have a |
stephentoub
commented
Jun 22, 2024
|
hez2010
commented
Jun 22, 2024
That one didn't cover |
I believe there's no reason to keep
FileStreamnon-async by default after we rewroteFileStreamsince .NET 7.Flipping the switch to
truecan benefit all APIs likeFile.Open,File.OpenWrite,File.Createand etc.