blob: 8412ba324570dcc188bb5de7d9a9436475b3aacb [file] [log] [blame]
Jan Tattermuschc91bc022017-05-19 14:49:26 +02001#region Copyright notice and license
2
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003// Copyright 2015 gRPC authors.
Jan Tattermuschc91bc022017-05-19 14:49:26 +02004//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02005// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
Jan Tattermuschc91bc022017-05-19 14:49:26 +02008//
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009// http://www.apache.org/licenses/LICENSE-2.0
Jan Tattermuschc91bc022017-05-19 14:49:26 +020010//
Jan Tattermusch7897ae92017-06-07 22:57:36 +020011// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
Jan Tattermuschc91bc022017-05-19 14:49:26 +020016
17#endregion
18
19using System;
Jan Tattermusche58842f2017-05-19 15:52:05 +020020using Grpc.Core;
21using Grpc.Core.Internal;
Jan Tattermusch645ae742017-05-22 08:46:26 -070022using Grpc.Core.Logging;
Jan Tattermuschc91bc022017-05-19 14:49:26 +020023
24namespace Grpc.Microbenchmarks
25{
26 class Program
27 {
28 public static void Main(string[] args)
29 {
Jan Tattermusch645ae742017-05-22 08:46:26 -070030 GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error));
Jan Tattermusche58842f2017-05-19 15:52:05 +020031 var benchmark = new SendMessageBenchmark();
32 benchmark.Init();
33 foreach (int threadCount in new int[] {1, 1, 2, 4, 8, 12})
34 {
35 benchmark.Run(threadCount, 4 * 1000 * 1000, 0);
36 }
37 benchmark.Cleanup();
Jan Tattermuschc91bc022017-05-19 14:49:26 +020038 }
39 }
40}