We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Processing dotnet/runtime#112417 (comment) command:
-intel
using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; using System.Net; using System.Net.Sockets; BenchmarkSwitcher.FromAssembly(typeof(SocketBench).Assembly).Run(args); [MemoryDiagnoser] public class SocketBench { private Socket? _listener; private Socket? _receiver; private Socket? _sender; private CancellationTokenSource? _cts; private byte[] _sendBuffer = new byte[16]; [Benchmark] public int Send() => _sender!.Send(_sendBuffer); [Benchmark] public async Task<int> SendAsync() => await _sender!.SendAsync(_sendBuffer, SocketFlags.None, default); [Benchmark] public void CreateClose() { Socket sock = new Socket(SocketType.Stream, ProtocolType.Tcp); sock.Dispose(); } [GlobalSetup(Targets = [nameof(Send), nameof(SendAsync)])] public async Task Setup() { _listener = new Socket(SocketType.Stream, ProtocolType.Tcp); _listener.Bind(new IPEndPoint(IPAddress.IPv6Loopback, 0)); IPEndPoint serverEp = (IPEndPoint)_listener.LocalEndPoint!; _listener.Listen(); Task<Socket> acceptTask = _listener.AcceptAsync(); _sender = new Socket(SocketType.Stream, ProtocolType.Tcp); await _sender.ConnectAsync(serverEp); _receiver = await acceptTask; _cts = new CancellationTokenSource(); _ = RunServer(); async Task RunServer() { byte[] rcvBuffer = new byte[16]; try { while (!_cts.Token.IsCancellationRequested) { await _receiver.ReceiveAsync(rcvBuffer, _cts.Token); } } catch (OperationCanceledException) { } } } [GlobalCleanup(Targets = [nameof(Send), nameof(SendAsync)])] public void Cleanup() { _cts?.Cancel(); _receiver?.Dispose(); _listener?.Dispose(); _sender?.Dispose(); } }
(EgorBot will reply in this issue)
The text was updated successfully, but these errors were encountered:
linux_azure_cascadelake
BenchmarkDotNet v0.14.0, Ubuntu 24.04.1 LTS (Noble Numbat) Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 8 logical and 4 physical cores Job-BZNWLL : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI Job-PIBQFT : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
BDN_Artifacts.zip
cc @antonfirsov (agent_logs.txt). EgorBot manual: link.
Sorry, something went wrong.
No branches or pull requests
Processing dotnet/runtime#112417 (comment) command:
Command
-intel
(EgorBot will reply in this issue)
The text was updated successfully, but these errors were encountered: