Skip to content

Commit 5294e9a

Browse files
added FastHash benchmark (#5029)
1 parent aa8a3de commit 5294e9a

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using Akka.Benchmarks.Configurations;
5+
using Akka.Remote.Serialization;
6+
using BenchmarkDotNet.Attributes;
7+
8+
namespace Akka.Benchmarks.Remoting
9+
{
10+
[Config(typeof(MicroBenchmarkConfig))]
11+
public class FastHashBenchmarks
12+
{
13+
public const string HashKey1 = "hash1";
14+
15+
[Benchmark]
16+
public int FastHash_OfString()
17+
{
18+
return FastHash.OfString(HashKey1);
19+
}
20+
21+
[Benchmark]
22+
public int FastHash_OfStringUnsafe()
23+
{
24+
return FastHash.OfStringFast(HashKey1);
25+
}
26+
}
27+
}

src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://github.com/akkadotnet/akka.net")]
2+
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.Benchmarks")]
23
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.Cluster")]
34
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.Cluster.Metrics")]
45
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.Cluster.Sharding")]

src/core/Akka.Remote/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@
3434
[assembly: InternalsVisibleTo("Akka.Cluster.Tools")]
3535
[assembly: InternalsVisibleTo("Akka.Cluster.Sharding")]
3636
[assembly: InternalsVisibleTo("Akka.Cluster.Metrics")]
37+
[assembly: InternalsVisibleTo("Akka.Benchmarks")]

0 commit comments

Comments
 (0)