Repository navigation
adding GetChild benchmark - #5239
Conversation
|
How many layers deep do the children get here? Is there a way we can somehow measure difference in perf based on how deep the path is? |
|
Data so far: BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19041.1165 (2004/May2020Update/20H1)
AMD Ryzen 7 1700, 1 CPU, 16 logical and 8 physical cores
.NET SDK=5.0.302
[Host] : .NET Core 3.1.17 (CoreCLR 4.700.21.31506, CoreFX 4.700.21.31502), X64 RyuJIT
DefaultJob : .NET Core 3.1.17 (CoreCLR 4.700.21.31506, CoreFX 4.700.21.31502), X64 RyuJIT
|
I can add a method to traverse the graph a few layers deeper, yes |
|
Ideally, this is the path we want to optimize read-side in Akka.Remote: akka.net/src/core/Akka/Actor/ActorRefProvider.cs Lines 465 to 479 in 426111f It gets called twice per-read and doesn't appear to be cached at all. |
|
Ah, I take that back - looks like we do cache inside RARP here: /// <summary>
/// Resolves a deserialized path into an <see cref="IActorRef"/>
/// </summary>
/// <param name="path">The path of the actor we are attempting to resolve.</param>
/// <returns>A local <see cref="IActorRef"/> if it exists, <see cref="ActorRefs.Nobody"/> otherwise.</returns>
public IActorRef ResolveActorRef(string path)
{
if (IgnoreActorRef.IsIgnoreRefPath(path))
return IgnoreRef;
// using thread local LRU cache, which will call InternalResolveActorRef
// if the value is not cached
if (_actorRefResolveThreadLocalCache == null)
{
return InternalResolveActorRef(path); // cache not initialized yet
}
return _actorRefResolveThreadLocalCache.Cache.GetOrCompute(path);
} |
|
Actually, funnily enough no - that doesn't get used at all inside the |
|
Done, expanded the benchmark to include some more scenarios. BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19041.1165 (2004/May2020Update/20H1)
AMD Ryzen 7 1700, 1 CPU, 16 logical and 8 physical cores
.NET SDK=5.0.302
[Host] : .NET Core 3.1.17 (CoreCLR 4.700.21.31506, CoreFX 4.700.21.31502), X64 RyuJIT
DefaultJob : .NET Core 3.1.17 (CoreCLR 4.700.21.31506, CoreFX 4.700.21.31502), X64 RyuJIT
|
Working on cleaning up the read-side resolve pipeline inside Akka.Cluster.Sharding and Akka.Remote. This seemed like a good place to start.