Skip to content

Commit

Permalink
added real UID to ActorPathBenchmarks (#6276)
Browse files Browse the repository at this point in the history
While working on #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 29, 2022
1 parent 76c9364 commit bb7435e
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 bb7435e

Please sign in to comment.