aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2017-12-08 14:06:05 -0800
committerGravatar GitHub <noreply@github.com>2017-12-08 14:06:05 -0800
commit7a64e6964e18c4c9a642134ebea89ccbb5c75c2e (patch)
tree9651da3926ea8abd638f675efc388ea74c5a9cb4 /src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs
parent5b1a66cef125ef0dcc99c792a52ce76bc380564a (diff)
parent1aee9d9880cf2d10fc14b884f0bc94a37b0a1162 (diff)
Merge pull request #13521 from jtattermusch/csharp_requestcallcontext_pooling
C#: Reuse RequestCallContextSafeHandle objects by pooling them.
Diffstat (limited to 'src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs')
-rw-r--r--src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs
index eefdb50e39..bb57a6968f 100644
--- a/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs
+++ b/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs
@@ -43,7 +43,7 @@ namespace Grpc.Microbenchmarks
public void Run(int threadCount, int iterations, bool useSharedRegistry)
{
Console.WriteLine(string.Format("CompletionRegistryBenchmark: threads={0}, iterations={1}, useSharedRegistry={2}", threadCount, iterations, useSharedRegistry));
- CompletionRegistry sharedRegistry = useSharedRegistry ? new CompletionRegistry(environment, () => BatchContextSafeHandle.Create()) : null;
+ CompletionRegistry sharedRegistry = useSharedRegistry ? new CompletionRegistry(environment, () => BatchContextSafeHandle.Create(), () => RequestCallContextSafeHandle.Create()) : null;
var threadedBenchmark = new ThreadedBenchmark(threadCount, () => ThreadBody(iterations, sharedRegistry));
threadedBenchmark.Run();
// TODO: parametrize by number of pending completions
@@ -51,7 +51,7 @@ namespace Grpc.Microbenchmarks
private void ThreadBody(int iterations, CompletionRegistry optionalSharedRegistry)
{
- var completionRegistry = optionalSharedRegistry ?? new CompletionRegistry(environment, () => BatchContextSafeHandle.Create());
+ var completionRegistry = optionalSharedRegistry ?? new CompletionRegistry(environment, () => throw new NotImplementedException(), () => throw new NotImplementedException());
var ctx = BatchContextSafeHandle.Create();
var stopwatch = Stopwatch.StartNew();