You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.
The text was updated successfully, but these errors were encountered: