-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
all RandomAccess methods should work for both sync and async file handles #54266
Conversation
Tagging subscribers to this area: @dotnet/area-system-io Issue Details
|
/azp list |
/azp run runtime-libraries-coreclr outerloop-windows |
Azure Pipelines successfully started running 1 pipeline(s). |
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/Strategies/WindowsFileStreamStrategy.cs
Show resolved
Hide resolved
For the following benchmarks I got these results:
So it's definitely a tradeoff (faster execution, but more allocations). If we use .NET 5.0 as base it's an improvement for both cpu and memory. I am inclined to say that it's a good trade off |
Co-authored-by: campersau <[email protected]>
+1 |
I can see that CI has discovered some actual bugs (either in the implementation or the tests themselves). I am going to take a look at this on Monday, as I am taking today and tomorrow off. |
# Conflicts: # src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj
/azp run runtime-libraries-coreclr outerloop-windows |
Azure Pipelines successfully started running 1 pipeline(s). |
…ely and GetLastError() returns SUCCESS instead of PENDING
/azp run runtime-libraries-coreclr outerloop-windows |
Azure Pipelines successfully started running 1 pipeline(s). |
@stephentoub the PR is ready for review, all scenarios are working. Updated benchmark numbers below: BenchmarkDotNet=v0.13.0.1559-nightly, OS=Windows 10.0.19041.1052 (2004/May2020Update/20H1)
AMD Ryzen Threadripper PRO 3945WX 12-Cores, 1 CPU, 24 logical and 12 physical cores
.NET SDK=6.0.100-preview.4.21255.9
[Host] : .NET 6.0.0 (6.0.21.25307), X64 RyuJIT
Job-FWJDGP : .NET 6.0.0 (42.42.42.42424), X64 RyuJIT
Job-ATTUMP : .NET 6.0.0 (42.42.42.42424), X64 RyuJIT
|
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
(My only remaining hesitation about this approach is, in theory, you could end up with a backlog of NativeOverlappeds that need to be freed, as we've effectively removed the implicit backpressure of that work being associated with the actual operation. But that's unlikely to be impactful in practice.)
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Outdated
Show resolved
Hide resolved
@DrewScoggins thank you! |
No description provided.