From 2b5480a4e323c85eb4b800a8af4ddcdd0d5d9ced Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 31 Jul 2023 20:46:59 -0500 Subject: [PATCH 1/3] added dotTrace diagnoser to Benchmark.NET projects --- src/benchmark/Akka.Benchmarks/Akka.Benchmarks.csproj | 1 + .../Akka.Cluster.Benchmarks/Akka.Cluster.Benchmarks.csproj | 1 + .../Sharding/ShardMessageRoutingBenchmarks.cs | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/benchmark/Akka.Benchmarks/Akka.Benchmarks.csproj b/src/benchmark/Akka.Benchmarks/Akka.Benchmarks.csproj index 1e6d76d303c..2a89bc8a0ef 100644 --- a/src/benchmark/Akka.Benchmarks/Akka.Benchmarks.csproj +++ b/src/benchmark/Akka.Benchmarks/Akka.Benchmarks.csproj @@ -7,6 +7,7 @@ + diff --git a/src/benchmark/Akka.Cluster.Benchmarks/Akka.Cluster.Benchmarks.csproj b/src/benchmark/Akka.Cluster.Benchmarks/Akka.Cluster.Benchmarks.csproj index 9eba3f3eff2..f11de3a8815 100644 --- a/src/benchmark/Akka.Cluster.Benchmarks/Akka.Cluster.Benchmarks.csproj +++ b/src/benchmark/Akka.Cluster.Benchmarks/Akka.Cluster.Benchmarks.csproj @@ -6,6 +6,7 @@ + diff --git a/src/benchmark/Akka.Cluster.Benchmarks/Sharding/ShardMessageRoutingBenchmarks.cs b/src/benchmark/Akka.Cluster.Benchmarks/Sharding/ShardMessageRoutingBenchmarks.cs index 4067bbec1f2..056843d2f69 100644 --- a/src/benchmark/Akka.Cluster.Benchmarks/Sharding/ShardMessageRoutingBenchmarks.cs +++ b/src/benchmark/Akka.Cluster.Benchmarks/Sharding/ShardMessageRoutingBenchmarks.cs @@ -14,10 +14,12 @@ using Akka.Cluster.Sharding; using Akka.Routing; using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Diagnostics.dotTrace; using static Akka.Cluster.Benchmarks.Sharding.ShardingHelper; namespace Akka.Cluster.Benchmarks.Sharding { + [DotTraceDiagnoser] [Config(typeof(MonitoringConfig))] public class ShardMessageRoutingBenchmarks { From 03e0609d05951059ce00fd5fa73ed1e5c1cda885 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 31 Jul 2023 21:00:40 -0500 Subject: [PATCH 2/3] added RPS numbers to Sharding round trip benchmarks --- .../Sharding/ShardMessageRoutingBenchmarks.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/benchmark/Akka.Cluster.Benchmarks/Sharding/ShardMessageRoutingBenchmarks.cs b/src/benchmark/Akka.Cluster.Benchmarks/Sharding/ShardMessageRoutingBenchmarks.cs index 056843d2f69..0cd5e38311f 100644 --- a/src/benchmark/Akka.Cluster.Benchmarks/Sharding/ShardMessageRoutingBenchmarks.cs +++ b/src/benchmark/Akka.Cluster.Benchmarks/Sharding/ShardMessageRoutingBenchmarks.cs @@ -26,10 +26,9 @@ public class ShardMessageRoutingBenchmarks [Params(StateStoreMode.Persistence, StateStoreMode.DData)] public StateStoreMode StateMode; - [Params(10000)] - public int MsgCount; + public const int MsgCount = 10000; - public int BatchSize = 20; + public const int BatchSize = 20; private ActorSystem _sys1; private ActorSystem _sys2; @@ -143,21 +142,21 @@ public void PerIteration() _batchActor = _sys1.ActorOf(Props.Create(() => new BulkSendActor(tcs, MsgCount))); } - [Benchmark] + [Benchmark(OperationsPerInvoke = MsgCount)] public async Task SingleRequestResponseToLocalEntity() { for (var i = 0; i < MsgCount; i++) await _shardRegion1.Ask(_messageToSys1); } - [Benchmark] + [Benchmark(OperationsPerInvoke = MsgCount * BatchSize)] public async Task StreamingToLocalEntity() { _batchActor.Tell(new BulkSendActor.BeginSend(_messageToSys1, _shardRegion1, BatchSize)); await _batchComplete; } - [Benchmark] + [Benchmark(OperationsPerInvoke = MsgCount)] public async Task SingleRequestResponseToRemoteEntity() { for (var i = 0; i < MsgCount; i++) @@ -165,14 +164,14 @@ public async Task SingleRequestResponseToRemoteEntity() } - [Benchmark] + [Benchmark(OperationsPerInvoke = MsgCount)] public async Task SingleRequestResponseToRemoteEntityWithLocalProxy() { for (var i = 0; i < MsgCount; i++) await _localRouter.Ask(new SendShardedMessage(_messageToSys2.EntityId, _messageToSys2)); } - [Benchmark] + [Benchmark(OperationsPerInvoke = MsgCount*BatchSize)] public async Task StreamingToRemoteEntity() { _batchActor.Tell(new BulkSendActor.BeginSend(_messageToSys2, _shardRegion1, BatchSize)); From 6d58055693f807f6c6463e90054a85e186fa6462 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 31 Jul 2023 21:02:16 -0500 Subject: [PATCH 3/3] git ignore dotTrace BDN output --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index c4e1346ef6d..a246deaade0 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,10 @@ PerfResults/ # BenchmarkDotNet files [rR]esults/ +# dotTrace files +*.dtp +*.dtp.* + # Visual Studo 2015 cache/options directory .vs/