예제 #1
0
        public async Task Throughput_GetReady(int messageCount)
        {
            IFighter <bool> fighter = new Fighter();
            IFighter <bool> proxy   = _directory.AsAddress(fighter);

            Stopwatch watch = Stopwatch.StartNew();

            watch.Reset();

            await proxy.GetReady();

            watch.Stop();

            _output.WriteLine("COLD (1 message to warm it up) => ");
            _output.WriteLine($"{((1 / watch.Elapsed.TotalMilliseconds) * 1000.0):0.000} msg/s");
            _output.WriteLine("");

            watch.Restart();

            for (var i = 0; i < messageCount; i++)
            {
                await proxy.GetReady();
            }

            watch.Stop();

            _output.WriteLine("");
            _output.WriteLine($"HOT ({messageCount:N0} messages) => ");
            _output.WriteLine($"{((messageCount / watch.Elapsed.TotalMilliseconds) * 1000.0):N2} msg/s");
            _output.WriteLine("");
        }
예제 #2
0
        public async Task CodeGenVoidTask()
        {
            int messageCount = Messages;

            for (var i = 0; i < messageCount; i++)
            {
                await _codegenProxy.GetReady();
            }
        }
예제 #3
0
        public async Task NativeVoidTask()
        {
            int messageCount = Messages;

            for (var i = 0; i < messageCount; i++)
            {
                await _staticProxy.GetReady();
            }
        }
예제 #4
0
 public async Task GetReady()
 {
     IFighter <bool> fighter = new Fighter();
     IFighter <bool> proxy   = _directory.AsAddress(fighter);
     await proxy.GetReady();
 }
예제 #5
0
 public ValueTask Invoke() => _target.GetReady();