Repository: microsoft/garnet
File: benchmark/BDN.benchmark/Network/NetworkBase.cs (C#)

Code before:

        /// <summary>
        /// Setup
        /// </summary>
        [GlobalSetup]
        public virtual void GlobalSetup()
        {
            var opts = new GarnetServerOptions
            {
                QuietMode = true,
                DisablePubSub = true,
            };

            server = new EmbeddedRespServer(opts, null, new GarnetServerEmbedded());
            networkHandler = server.GetNetworkHandler();

            // Send a PING message to warm up the session
            SlowConsumeMessage("PING\r\n"u8);
        }

        /// <summary>
        /// Cleanup
        /// </summary>
        [GlobalCleanup]
        public virtual void GlobalCleanup()
        {
            networkHandler.Dispose();
            server.Dispose();
        }

        protected ValueTask Send(Request request) => networkHandler.Send(request);

        protected unsafe void SetupOperation(ref Request request, ReadOnlySpan<byte> operation, int batchSize = batchSize)
        {
            request.buffer = GC.AllocateArray<byte>(operation.Length * batchSize, pinned: true);
            request.bufferPtr = (byte*)Unsafe.AsPointer(ref request.buffer[0]);
            for (int i = 0; i < batchSize; i++)
                operation.CopyTo(new Span<byte>(request.buffer).Slice(i * operation.Length));
        }

        protected void SlowConsumeMessage(ReadOnlySpan<byte> message)
        {
            Request request = default;
            SetupOperation(ref request, message, 1);
            Send(request);
        }
    }
}

Review comment (suggestion):
Use curly braces and separate lines for clarity. My message used shorthand for brevity.
```suggestion
        protected ValueTask Send(Request request)
        {
           return networkHandler.Send(request);
        }
```

Code after:
        public virtual void GlobalSetup()
        {
            var opts = new GarnetServerOptions
            {
                QuietMode = true,
                DisablePubSub = true,
            };

            server = new EmbeddedRespServer(opts, null, new GarnetServerEmbedded());
            networkHandler = server.GetNetworkHandler();

            // Send a PING message to warm up the session
            SlowConsumeMessage("PING\r\n"u8);
        }

        /// <summary>
        /// Cleanup
        /// </summary>
        [GlobalCleanup]
        public virtual void GlobalCleanup()
        {
            networkHandler.Dispose();
            server.Dispose();
        }

        protected ValueTask Send(Request request) => networkHandler.Send(request);

        protected unsafe void SetupOperation(ref Request request, ReadOnlySpan<byte> operation, int batchSize = batchSize)
        {
            request.buffer = GC.AllocateArray<byte>(operation.Length * batchSize, pinned: true);
            request.bufferPtr = (byte*)Unsafe.AsPointer(ref request.buffer[0]);
            for (int i = 0; i < batchSize; i++)
                operation.CopyTo(new Span<byte>(request.buffer).Slice(i * operation.Length));
        }

        protected void SlowConsumeMessage(ReadOnlySpan<byte> message)
        {
            Request request = default;
            SetupOperation(ref request, message, 1);
            Send(request);
        }
    }
}