Skip to content

Commit

Permalink
added real UID to ActorPathBenchmarks (akkadotnet#6276)
Browse files Browse the repository at this point in the history
While working on akkadotnet#6195 I realized that none of those `ActorPath`s actually have a set UID, thus we're missing that entire facet from both the parsing and serialization benchmarks.
  • Loading branch information
Aaronontheweb committed Nov 30, 2022
1 parent 5620535 commit e39c16b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/benchmark/Akka.Benchmarks/Actor/ActorPathBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// </copyright>
//-----------------------------------------------------------------------

using System;
using Akka.Actor;
using Akka.Benchmarks.Configurations;
using BenchmarkDotNet.Attributes;
Expand All @@ -20,18 +21,25 @@ public class ActorPathBenchmarks
private Address _sysAdr = new Address("akka.tcp", "system", "127.0.0.1", 1337);
private Address _otherAdr = new Address("akka.tcp", "system", "127.0.0.1", 1338);

private string _actorPathStr;

[Params(1, 100000, int.MaxValue)]
public int Uid { get; set; }

[GlobalSetup]
public void Setup()
{
x = new RootActorPath(_sysAdr, "user");
y = new RootActorPath(_sysAdr, "system");
_childPath = x / "parent" / "child";
var parentPath = x / "parent";
_childPath = new ChildActorPath(parentPath, "child", Uid);
_actorPathStr = _childPath.ToSerializationFormat();
}

[Benchmark]
public ActorPath ActorPath_Parse()
{
return ActorPath.Parse("akka.tcp://system/user/parent/child");
return ActorPath.Parse(_actorPathStr);
}

[Benchmark]
Expand Down

0 comments on commit e39c16b

Please sign in to comment.