Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added dotTrace diagnoser to Benchmark.NET projects #6864

Merged
merged 5 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ PerfResults/
# BenchmarkDotNet files
[rR]esults/

# dotTrace files
*.dtp
*.dtp.*

# Visual Studo 2015 cache/options directory
.vs/

Expand Down
1 change: 1 addition & 0 deletions src/benchmark/Akka.Benchmarks/Akka.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="$(BenchmarkDotNetVersion)" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.dotTrace" Version="0.13.6" />
<!-- FluentAssertions is used in some benchmarks to validate internal behaviors -->
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="$(BenchmarkDotNetVersion)" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.dotTrace" Version="0.13.6" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@
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
{
[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;
Expand Down Expand Up @@ -141,36 +142,36 @@ 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<ShardedMessage>(_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++)
await _shardRegion1.Ask<ShardedMessage>(_messageToSys2);
}


[Benchmark]
[Benchmark(OperationsPerInvoke = MsgCount)]
public async Task SingleRequestResponseToRemoteEntityWithLocalProxy()
{
for (var i = 0; i < MsgCount; i++)
await _localRouter.Ask<ShardedMessage>(new SendShardedMessage(_messageToSys2.EntityId, _messageToSys2));
}

[Benchmark]
[Benchmark(OperationsPerInvoke = MsgCount*BatchSize)]
public async Task StreamingToRemoteEntity()
{
_batchActor.Tell(new BulkSendActor.BeginSend(_messageToSys2, _shardRegion1, BatchSize));
Expand Down