-
-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b6e1742
commit 591b07e
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//this is not intended to show performance, nor any functionality | ||
//this is only for measuring Props memory consumption | ||
|
||
using PropsBenchmark; | ||
using Proto; | ||
|
||
var system = new ActorSystem(); | ||
var props = Props.FromFunc(ctx => Task.CompletedTask); | ||
|
||
Console.WriteLine("Starting"); | ||
for (var i = 0; i < 1_000_000; i++) | ||
{ | ||
var p = props.WithOnInit(ctx => { | ||
ctx.Set(new SomeState("SomeId" + i)); | ||
} | ||
); | ||
|
||
var pid = system.Root.Spawn(p); | ||
} | ||
|
||
Console.WriteLine("Done"); | ||
|
||
Console.ReadLine(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Proto.Cluster\Proto.Cluster.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file = "SomeState.cs" company = "Asynkron AB"> | ||
// Copyright (C) 2015-2022 Asynkron AB All rights reserved | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
namespace PropsBenchmark; | ||
|
||
public record SomeState(string Name); |