Skip to content

Commit

Permalink
Merge pull request #3480 from akkadotnet/dev
Browse files Browse the repository at this point in the history
Akka.NET v1.3.8 Stable Release
  • Loading branch information
Aaronontheweb authored Jun 4, 2018
2 parents bb80ab3 + cc0fe3c commit 37eeb37
Show file tree
Hide file tree
Showing 60 changed files with 2,645 additions and 178 deletions.
41 changes: 40 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
#### 1.3.7 April 17 2018 ####
#### 1.3.8 June 04 2018 ####
**Maintenance Release for Akka.NET 1.3**

Akka.NET v1.3.8 is a minor patch consisting mostly of bug fixes as well as an upgrade to DotNetty v0.4.8.

**DotNetty v0.4.8 Upgrade**
You can [read the release notes for DotNetty v0.4.8 here](https://github.com/Azure/DotNetty/blob/5eee925b7597c6b07689f25f328966e330ff58f9/RELEASE_NOTES.md) - but here are the major improvements as they pertain to Akka.NET:

1. DotNetty length-frame decoding is now fully-supported on .NET Core on Linux and
2. Socket shutdown code has been improved, which fixes a potential "port exhaustion" issue reported by Akka.Remote users.

If you've been affected by either of these issues, we strongly encourage that you upgrade your applications to Akka.NET v1.3.8 as soon as possible.

**Updates and Additions**
1. [Akka.Streams: add PreMaterialize support for Sources](https://github.com/akkadotnet/akka.net/pull/3476)
2. [Akka.Streams: add PreMaterialize support for Sinks](https://github.com/akkadotnet/akka.net/pull/3477)
3. [Akka.Streams:
Port Pulse, DelayFlow and Valve streams-contrib stages](https://github.com/akkadotnet/akka.net/pull/3421)
4. [Akka.FSharp: Unit test Akka.FSharp.System.create with extensions](https://github.com/akkadotnet/akka.net/pull/3407)

Relevant documentation for Akka.Streams pre-materialization, for those who are interested: http://getakka.net/articles/streams/basics.html#source-pre-materialization

**Bugfixes**
1. [Akka.Remote: ActorSelection fails for ActorPath from remotely deployed actors](https://github.com/akkadotnet/akka.net/issues/1544)
2. [Akka.Remote: WilcardCard ActorSelections that fail to match any actors don't deliver messages into DeadLetters](https://github.com/akkadotnet/akka.net/issues/3420)
3. [Akka.Cluster: SplitBrainResolver logs "network partition detected" after change in cluster membership, even when no unreachable nodes](https://github.com/akkadotnet/akka.net/issues/3450)
4. [Akka: SynchronizationLockException in user-defined mailboxes](https://github.com/akkadotnet/akka.net/issues/3459)
5. [Akka: UnhandledMessageForwarder crashes and restarted every time the app is starting](https://github.com/akkadotnet/akka.net/issues/3267)

| COMMITS | LOC+ | LOC- | AUTHOR |
| --- | --- | --- | --- |
| 17 | 498 | 171 | Aaron Stannard |
| 4 | 1054 | 23 | Bartosz Sypytkowski |
| 2 | 2 | 2 | Fábio Beirão |
| 2 | 16 | 2 | Aaron Palmer |
| 1 | 1063 | 4 | Oleksandr Bogomaz |
| 1 | 1 | 1 | Ismael Hamed |
| 1 | 1 | 1 | Gauthier Segay |

#### 1.3.7 May 15 2018 ####
**Maintenance Release for Akka.NET 1.3**

Akka.NET v1.3.7 is a minor patch consisting mostly of bug fixes.
Expand Down
6 changes: 3 additions & 3 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,9 @@ Target "PublishNuget" (fun _ ->
Target "Protobuf" <| fun _ ->

let protocPath =
if isWindows then findToolInSubPath "protoc.exe" "src/packages/Google.Protobuf.Tools/tools/windows_x64"
elif isMacOS then findToolInSubPath "protoc" "src/packages/Google.Protobuf.Tools/tools/macosx_x64"
else findToolInSubPath "protoc" "src/packages/Google.Protobuf.Tools/tools/linux_x64"
if isWindows then findToolInSubPath "protoc.exe" "tools/Google.Protobuf.Tools/tools/windows_x64"
elif isMacOS then findToolInSubPath "protoc" "tools/Google.Protobuf.Tools/tools/macosx_x64"
else findToolInSubPath "protoc" "tools/Google.Protobuf.Tools/tools/linux_x64"

let protoFiles = [
("WireFormats.proto", "/src/core/Akka.Remote/Serialization/Proto/");
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ NUGET_URL=https://dist.nuget.org/win-x86-commandline/v4.3.0/nuget.exe
FAKE_VERSION=4.63.0
FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe
DOTNET_EXE=$SCRIPT_DIR/.dotnet/dotnet
DOTNET_VERSION=2.0.0
DOTNET_VERSION=1.1.0
DOTNET_INSTALLER_URL=https://raw.githubusercontent.com/dotnet/cli/v$DOTNET_VERSION/scripts/obtain/dotnet-install.sh
PROTOBUF_VERSION=3.4.0

Expand Down
2 changes: 1 addition & 1 deletion docs/articles/persistence/persistence-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public class ExampleStore
{
public Task<object> Save(object evt)
{
return Task.FromResult(default(object));
return Task.FromResult(evt);
}
}
```
Expand Down
9 changes: 8 additions & 1 deletion docs/articles/streams/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,14 @@ RunnableGraph<Tuple<TaskCompletionSource<int>, ICancelable, Task<int>>> r12 =
> [!NOTE]
> In Graphs it is possible to access the materialized value from inside the stream processing graph.
> For details see [Accessing the materialized value inside the Graph](xref:streams-working-with-graphs#accessing-the-materialized-value-inside-the-graph).
### Source pre-materialization
There are situations in which you require a `Source` materialized value **before** the `Source` gets hooked up to the rest of the graph.
This is particularly useful in the case of "materialized value powered" `Source`s, like `Source.Queue`, `Source.ActorRef` or `Source.Maybe`.

By using the `PreMaterialize` operator on a `Source`, you can obtain its materialized value and another `Source`. The latter can be used to consume messages from the original `Source`. Note that this can be materialized multiple times.

[!code-csharp[FlowDocTests.cs](../../examples/DocsExamples/Streams/FlowDocTests.cs?name=source-prematerialization)]

## Stream ordering
In Akka Streams almost all computation stages *preserve input order* of elements. This means that if inputs ``{IA1,IA2,...,IAn}``
Expand Down
14 changes: 13 additions & 1 deletion docs/articles/streams/builtinstages.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ elements or failing the stream, the strategy is chosen by the user.

**completes** when the actorref is sent ``Akka.Actor.Status.Success`` or ``PoisonPill``

#### PreMaterialize

Materializes this Source, immediately returning (1) its materialized value, and (2) a new Source that can consume elements 'into' the pre-materialized one.

Useful for when you need a materialized value of a Source when handing it out to someone to materialize it for you.

#### Combine

Combine several sources, using a given strategy such as merge or concat, into one source.
Expand Down Expand Up @@ -359,7 +365,13 @@ to provide back pressure onto the sink.

**cancels** when the actor terminates

**backpressures** when the actor acknowledgement has not arrived
**backpressures** when the actor acknowledgement has not arrived.

#### PreMaterialize

Materializes this Sink, immediately returning (1) its materialized value, and (2) a new Sink that can consume elements 'into' the pre-materialized one.

Useful for when you need a materialized value of a Sink when handing it out to someone to materialize it for you.


#### ActorSubscriber
Expand Down
4 changes: 2 additions & 2 deletions docs/articles/streams/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Streams Introduction
# Introduction

## Motivation
The way we consume services from the internet today includes many instances of streaming data, both downloading from a service as well as uploading to it or peer-to-peer data transfers. Regarding data as a stream of elements instead of in its entirety is very useful because it matches the way computers send and receive them (for example via TCP), but it is often also a necessity because data sets frequently become to large to be handled as a whole. We spread computations or analyses over large clusters and call it "big data", where the whole principle of processing them is by feeding those data sequentially --as a stream-- through some CPUs.
The way we consume services from the internet today includes many instances of streaming data, both downloading from a service as well as uploading to it or peer-to-peer data transfers. Regarding data as a stream of elements instead of in its entirety is very useful because it matches the way computers send and receive them (for example via TCP), but it is often also a necessity because data sets frequently become too large to be handled as a whole. We spread computations or analyses over large clusters and call it "big data", where the whole principle of processing them is by feeding those data sequentially --as a stream-- through some CPUs.

Actors can be seen as dealing with streams as well: they send and receive series of messages in order to transfer knowledge (or data) from one place to another. We have found it tedious and error-prone to implement all the proper measures in order to achieve stable streaming between actors, since in addition to sending and receiving we also need to take care to not overflow any buffers or mailboxes in the process. Another pitfall is that Actor messages can be lost and must be retransmitted in that case lest the stream have holes on the receiving side. When dealing with streams of elements of a fixed given type, Actors also do not currently offer good static guarantees that no wiring errors are made: type-safety could be improved in this case.

Expand All @@ -18,7 +18,7 @@ The Akka Streams API is completely decoupled from the Reactive Streams interface
The relationship between these two is that the Akka Streams API is geared towards end-users while the Akka Streams implementation uses the Reactive Streams interfaces internally to pass data between the different processing stages. For this reason you will not find any resemblance between the Reactive Streams interfaces and the Akka Streams API. This is in line with the expectations of the Reactive Streams project, whose primary purpose is to define interfaces such that different streaming implementation can interoperate; it is not the purpose of Reactive Streams to describe an end-user API.

## How to read these docs
Stream processing is a different paradigm to the Actor Model or to Task composition, therefore it may take some careful study of this subject until you feel familiair with the tools and techniques. The documentation is here to help and for best results we recommend the following approach:
Stream processing is a different paradigm to the Actor Model or to Task composition, therefore it may take some careful study of this subject until you feel familiar with the tools and techniques. The documentation is here to help and for best results we recommend the following approach:

* Read the [Quick Start Guide](xref:streams-quickstart) to get a feel for how streams look like and what they can do.
* The top-down learners may want to peruse the [Design Principles behind Akka Streams](xref:streams-design-principles) at this point.
Expand Down
34 changes: 34 additions & 0 deletions docs/examples/DocsExamples/Streams/FlowDocTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using Akka;
using Akka.Actor;
using Akka.Streams;
using Akka.Streams.Dsl;
using Akka.TestKit.Xunit2;
using Xunit;

namespace DocsExamples.Streams
{
public class FlowDocTests : TestKit
{
[Fact]
public void Source_prematerialization()
{
#region source-prematerialization

var matPoweredSource =
Source.ActorRef<string>(bufferSize: 100, overflowStrategy: OverflowStrategy.Fail);

Tuple<IActorRef, Source<string, NotUsed>> materialized = matPoweredSource.PreMaterialize(Sys.Materializer());

var actorRef = materialized.Item1;
var source = materialized.Item2;

actorRef.Tell("hit");

// pass source around for materialization
source.RunWith(Sink.ForEach<string>(Console.WriteLine), Sys.Materializer());

#endregion
}
}
}
4 changes: 4 additions & 0 deletions docs/examples/Tutorials/Tutorials.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
49 changes: 32 additions & 17 deletions src/Akka.sln
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Cluster.Tests.Performa
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.DistributedData.LightningDB", "contrib\cluster\Akka.DistributedData.LightningDB\Akka.DistributedData.LightningDB.csproj", "{99CCB7CA-E1EE-4497-BF52-2200A0EC5CB1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpawnBenchmark", "benchmark\SpawnBenchmark\SpawnBenchmark.csproj", "{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RemotePingPong", "benchmark\RemotePingPong\RemotePingPong.csproj", "{5AA81B79-34DD-4DD7-9D40-A5CA389786DF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{D3AF8295-AEB5-4324-AA82-FCC0014AC310}"
Expand All @@ -188,9 +186,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Cluster.Simple", "e
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Cluster.Transformation", "examples\Cluster\Roles\Samples.Cluster.Transformation\Samples.Cluster.Transformation.csproj", "{01B074DB-67C8-4600-8CE2-DAAAFC052261}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Akka.FSharp", "core/Akka.FSharp/Akka.FSharp.fsproj", "{483B4579-2665-49FC-A7E4-42C67FEC7531}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Akka.FSharp", "core\Akka.FSharp\Akka.FSharp.fsproj", "{483B4579-2665-49FC-A7E4-42C67FEC7531}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Akka.FSharp.Tests", "core\Akka.FSharp.Tests\Akka.FSharp.Tests.fsproj", "{FA2E30CC-9F2D-4BFC-9899-347B32DF7181}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Benchmarks", "benchmark\Akka.Benchmarks\Akka.Benchmarks.csproj", "{A1D57384-A933-480A-9DF4-FA5E60AB1A67}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Akka.FSharp.Tests", "core/Akka.FSharp.Tests/Akka.FSharp.Tests.fsproj", "{FA2E30CC-9F2D-4BFC-9899-347B32DF7181}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpawnBenchmark", "benchmark\SpawnBenchmark\SpawnBenchmark.csproj", "{9BEAF609-B406-4CCB-9708-6E8DFF764232}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -695,18 +697,6 @@ Global
{99CCB7CA-E1EE-4497-BF52-2200A0EC5CB1}.Release|x64.Build.0 = Release|Any CPU
{99CCB7CA-E1EE-4497-BF52-2200A0EC5CB1}.Release|x86.ActiveCfg = Release|Any CPU
{99CCB7CA-E1EE-4497-BF52-2200A0EC5CB1}.Release|x86.Build.0 = Release|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Debug|x64.ActiveCfg = Debug|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Debug|x64.Build.0 = Debug|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Debug|x86.ActiveCfg = Debug|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Debug|x86.Build.0 = Debug|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Release|Any CPU.Build.0 = Release|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Release|x64.ActiveCfg = Release|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Release|x64.Build.0 = Release|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Release|x86.ActiveCfg = Release|Any CPU
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D}.Release|x86.Build.0 = Release|Any CPU
{5AA81B79-34DD-4DD7-9D40-A5CA389786DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5AA81B79-34DD-4DD7-9D40-A5CA389786DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5AA81B79-34DD-4DD7-9D40-A5CA389786DF}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -815,6 +805,30 @@ Global
{FA2E30CC-9F2D-4BFC-9899-347B32DF7181}.Release|x64.Build.0 = Release|Any CPU
{FA2E30CC-9F2D-4BFC-9899-347B32DF7181}.Release|x86.ActiveCfg = Release|Any CPU
{FA2E30CC-9F2D-4BFC-9899-347B32DF7181}.Release|x86.Build.0 = Release|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Debug|x64.ActiveCfg = Debug|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Debug|x64.Build.0 = Debug|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Debug|x86.ActiveCfg = Debug|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Debug|x86.Build.0 = Debug|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Release|Any CPU.Build.0 = Release|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Release|x64.ActiveCfg = Release|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Release|x64.Build.0 = Release|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Release|x86.ActiveCfg = Release|Any CPU
{A1D57384-A933-480A-9DF4-FA5E60AB1A67}.Release|x86.Build.0 = Release|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Debug|x64.ActiveCfg = Debug|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Debug|x64.Build.0 = Debug|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Debug|x86.ActiveCfg = Debug|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Debug|x86.Build.0 = Debug|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Release|Any CPU.Build.0 = Release|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Release|x64.ActiveCfg = Release|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Release|x64.Build.0 = Release|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Release|x86.ActiveCfg = Release|Any CPU
{9BEAF609-B406-4CCB-9708-6E8DFF764232}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -885,7 +899,6 @@ Global
{E7A836C1-42D3-4ADC-81C6-C6C5398CC740} = {7625FD95-4B2C-4A5B-BDD5-94B1493FAC8E}
{94C10096-C33E-404E-B0FB-F8535512A952} = {01167D3C-49C4-4CDE-9787-C176D139ACDD}
{99CCB7CA-E1EE-4497-BF52-2200A0EC5CB1} = {76F58DC4-19F1-43EF-A6E2-EC1CC8395AC5}
{DA4BDE1E-1ACA-482A-9329-952C3E36F97D} = {73108242-625A-4D7B-AA09-63375DBAE464}
{5AA81B79-34DD-4DD7-9D40-A5CA389786DF} = {73108242-625A-4D7B-AA09-63375DBAE464}
{C50E1A9E-820C-4E75-AE39-6F96A99AC4A7} = {D3AF8295-AEB5-4324-AA82-FCC0014AC310}
{820CFBF7-E165-4ADA-B821-E6A0A81DFE84} = {C50E1A9E-820C-4E75-AE39-6F96A99AC4A7}
Expand All @@ -898,6 +911,8 @@ Global
{01B074DB-67C8-4600-8CE2-DAAAFC052261} = {C50E1A9E-820C-4E75-AE39-6F96A99AC4A7}
{483B4579-2665-49FC-A7E4-42C67FEC7531} = {01167D3C-49C4-4CDE-9787-C176D139ACDD}
{FA2E30CC-9F2D-4BFC-9899-347B32DF7181} = {01167D3C-49C4-4CDE-9787-C176D139ACDD}
{A1D57384-A933-480A-9DF4-FA5E60AB1A67} = {73108242-625A-4D7B-AA09-63375DBAE464}
{9BEAF609-B406-4CCB-9708-6E8DFF764232} = {73108242-625A-4D7B-AA09-63375DBAE464}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {03AD8E21-7507-4E68-A4E9-F4A7E7273164}
Expand Down
51 changes: 51 additions & 0 deletions src/benchmark/Akka.Benchmarks/Actor/ActorPathBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//-----------------------------------------------------------------------
// <copyright file="ActorPathBenchmarks.cs" company="Akka.NET Project">
// Copyright (C) 2009-2018 Lightbend Inc. <http://www.lightbend.com>
// Copyright (C) 2013-2018 .NET Foundation <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------

using Akka.Actor;
using Akka.Benchmarks.Configurations;
using BenchmarkDotNet.Attributes;

namespace Akka.Benchmarks.Actor
{
[Config(typeof(MicroBenchmarkConfig))]
public class ActorPathBenchmarks
{
private ActorPath x;
private ActorPath y;

[GlobalSetup]
public void Setup()
{
x = new RootActorPath(new Address("akka.tcp", "system", "127.0.0.1", 1337), "user");
y = new RootActorPath(new Address("akka.tcp", "system", "127.0.0.1", 1337), "system");
}

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

[Benchmark]
public ActorPath ActorPath_Concat()
{
return x / "parent" / "child";
}

[Benchmark]
public bool ActorPath_Equals()
{
return x == y;
}

[Benchmark]
public string ActorPath_ToString()
{
return x.ToString();
}
}
}
Loading

0 comments on commit 37eeb37

Please sign in to comment.