Skip to content

Win32 FileStream will issue a seek on every ReadAsync call #16354

@ayende

Description

@ayende

Full description is here:
https://ayende.com/blog/173345/the-cost-of-async-i-o?key=227b21e219594be48ca03bc8312b08b9

But the gist of it is that we are trying to call ReadAsync on a file that is located on a remote share.
Using ReadAsync, we saw a really horrible performance degradation.

We tracked it down to this issue:

image

And here is the problematic code:
https://github.com/dotnet/corefx/blob/master/src/System.IO.FileSystem/src/System/IO/Win32FileStream.cs#L1201

Given that all async calls are always passing the position they use in the overlap, and how expensive this call is, it make for a very bad combination.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions