Skip to content

Commit

Permalink
added benchmark for VirtualPathContainer resolution (#5244)
Browse files Browse the repository at this point in the history
designed to help measure how quickly we can resolve a temporary actor upon deserialization
  • Loading branch information
Aaronontheweb authored Sep 2, 2021
1 parent 77ed55d commit f0c0ebf
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/benchmark/Akka.Benchmarks/Actor/GetChildBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ protected override void OnReceive(object message)
private ActorCell _cell;
private RepointableActorRef _repointableActorRef;
private LocalActorRef _localActorRef;
private VirtualPathContainer _virtualPathContainer;

private List<string> _rpChildQueryPath = new List<string>() { "food", "ood", "od" };
private List<string> _lclChildQueryPath = new List<string>() { "ood", "od", "d" };
private List<string> _virtualPathContainerQueryPath = new List<string>() { "foo" };

[GlobalSetup]
public async Task Setup()
Expand All @@ -113,6 +115,15 @@ public async Task Setup()

_cell = _parentActor.As<ActorRefWithCell>().Underlying.As<ActorCell>();
_repointableActorRef = (RepointableActorRef)_parentActor;

var exp = _system.As<ExtendedActorSystem>();

var vPath = exp.Guardian.Path / "testTemp";
_virtualPathContainer =
new VirtualPathContainer(exp.Provider, vPath, exp.Guardian, exp.Log);

_virtualPathContainer.AddChild("foo",
new EmptyLocalActorRef(exp.Provider, vPath / "foo", exp.EventStream));
}

[Benchmark]
Expand All @@ -132,6 +143,12 @@ public void Resolve3DeepChildLocalActorRef()
{
_localActorRef.GetChild(_lclChildQueryPath);
}

[Benchmark]
public void ResolveVirtualPathContainer()
{
_virtualPathContainer.GetChild(_virtualPathContainerQueryPath);
}

[GlobalCleanup]
public void Cleanup()
Expand Down

0 comments on commit f0c0ebf

Please sign in to comment.