From b489b5e6945b4edf3226d401feaea879531ce68e Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 23 Jul 2019 13:59:26 -0400 Subject: [PATCH] review comments --- .../UnaryCallOverheadBenchmark.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs index a58a46695be..4953806f6f4 100644 --- a/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs @@ -24,13 +24,10 @@ using System; namespace Grpc.Microbenchmarks { - // this test creates a real server and client, measuring the inherent inbuilt - // platform overheads; the marshallers **DO NOT ALLOCATE**, so any allocations + // this test measures the overhead of C# wrapping layer when invoking calls; + // the marshallers **DO NOT ALLOCATE**, so any allocations // are from the framework, not the messages themselves - // important: allocs are not reliable on .NET Core until .NET Core 3, since - // this test involves multiple threads - [ClrJob, CoreJob] // test .NET Core and .NET Framework [MemoryDiagnoser] // allocations public class UnaryCallOverheadBenchmark @@ -41,7 +38,7 @@ namespace Grpc.Microbenchmarks private static readonly Method PingMethod = new Method(MethodType.Unary, nameof(PingBenchmark), "Ping", EmptyMarshaller, EmptyMarshaller); [Benchmark] - public string Ping() + public string SyncUnaryCallOverhead() { return client.Ping("", new CallOptions()); } @@ -52,7 +49,7 @@ namespace Grpc.Microbenchmarks [GlobalSetup] public void Setup() { - // create client + // create client, the channel will actually never connect because call logic will be short-circuited channel = new Channel("localhost", 10042, ChannelCredentials.Insecure); client = new PingClient(new DefaultCallInvoker(channel));