Improved performance for SemaphoreSlim locking.#21065
Improved performance for SemaphoreSlim locking.#21065maliming merged 9 commits intoabpframework:devfrom
Conversation
|
Thanks for your contribution. 👍 Can you use source code instead of nuget package? This way, we can easily maintain it. |
|
This uses a NuGet by Microsoft, not sure what the problem is. It's in there due to an improvement in performance for ValueTask that was included in .NET 5.0. #20530 will need to use an external dependency as some assembly-level attributes need to be set. #20531 would mean copying and pasting the library. |
|
If there are few code changes, we would prefer the source code rather than introducing a new Nuget package. |
Even if it's a Microsoft package? |
|
I see you referenced some of your packages. eg Backport.System.Threading.Lock, ListShuffle, ThreadSafeRandomizer |
Let's discuss on the appropriate PR please. On this PR the only addition is this:
|
|
We have used ConfigureAwait.Fody to add |
OK, I will update those. |
|
Updated @maliming . |
|
Thanks. I think we dont need the What is the purpose of |
There was an improvement in performance done to ValueTask. This improvement is included in .NET 5.0. I added the target for .NET 5.0 specifically so that on .NET 5.0, .NET 6.0 and .NET 7.0 the NuGet package is not added as a dependency, otherwise:
would need to change to:
And that would mean an unnecessary dependency for .NET 5.0 to .NET 7.0. |
|
I think we don't need the We can still use |
The system.threading.tasks.extensions is there for valuetask and has nothing to do with configureawait. |
Can you give an example of what we can get with this package? Thanks |
ValueTask was included in netcore2.1, so to use it before then (netstandard2.0) you need to use a package. Furthermore, this PR made ValueTask more performant and was included in net5.0, so the recommendation is to reference that library for < net5.0: dotnet/coreclr#26310 |
|
Furthermore please note that this package is still included transitively in abp. This is just moving it at the top level. |
|
ok, Thanks. We are not using |
|
If we do that then netcore 3.0 and 3.1 would have the unoptimal version. Are you sure you want this, code that performs better in netcore 2.1 than it does in netcore 3.1? |
|
So basically you have 3 options:
|
|
Almost no one uses ABP I think adding it to <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Threading.Tasks.Extensions" />
</ItemGroup> |
…incenti/abp into semaphoresliminlining
|
OK now it's as requested @maliming |
|
Thanks! |
No description provided.