ladeak
ladeak
The only thing might be interesting is [BufferExtensions](https://github.com/dotnet/aspnetcore/blame/48a07213d4d8df15c6dffccd161844842c196998/src/Shared/ServerInfrastructure/BufferExtensions.cs#L132) I think this is using `unsafe` to avoid a few boundary checks upon writing. I will test if it is safe to...
Yes that is my impression as well.
My concern is that under lock contention the new lock does not seem to perform that well in my tests on x64. Looks nice on the first benchmark, then I...
@kouvel let me attach the benchmarks and the results: ```csharp BenchmarkRunner.Run(); [SimpleJob] public class Benchmarks { private int _value = 0; private const int N = 10000; private readonly object...
@kouvel with `N = 1_000_000;` ``` BenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.4037/23H2/2023Update/SunValley3) 12th Gen Intel Core i7-1255U, 1 CPU, 12 logical and 10 physical cores .NET SDK 9.0.100-preview.7.24371.4 [Host] : .NET...
Take your time, I am going to sleep in the next few hours.
@kouvel ``` Monitor: 86,511 ns/change Monitor: 84,948 ns/change Monitor: 86,056 ns/change Monitor: 82,722 ns/change Monitor: 85,529 ns/change Monitor: 86,259 ns/change Monitor: 85,450 ns/change Monitor: 84,780 ns/change Lock: 78,784 ns/change Lock:...
@kouvel in your suggested measurement code I updated the `ThreadCount` const from value 4 to 2, and I get the following results: ``` Monitor: 23,446 ns/change Monitor: 22,299 ns/change Monitor:...
@BrennanConroy and @halter73 I think all questions are clarified.
I have been trying a few other things out, ie. WSL (Ubuntu 22.04.03), same machine 4 threads (the variance is huge between executions): ``` Monitor: 150.381 ns/change Monitor: 148.997 ns/change...