diff --git a/src/benchmark/Akka.Benchmarks/Remoting/FastHashBenchmarks.cs b/src/benchmark/Akka.Benchmarks/Remoting/FastHashBenchmarks.cs new file mode 100644 index 00000000000..87d3155de53 --- /dev/null +++ b/src/benchmark/Akka.Benchmarks/Remoting/FastHashBenchmarks.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Akka.Benchmarks.Configurations; +using Akka.Remote.Serialization; +using BenchmarkDotNet.Attributes; + +namespace Akka.Benchmarks.Remoting +{ + [Config(typeof(MicroBenchmarkConfig))] + public class FastHashBenchmarks + { + public const string HashKey1 = "hash1"; + + [Benchmark] + public int FastHash_OfString() + { + return FastHash.OfString(HashKey1); + } + + [Benchmark] + public int FastHash_OfStringUnsafe() + { + return FastHash.OfStringFast(HashKey1); + } + } +} diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt index 766d4f50243..c03de639b12 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt @@ -1,4 +1,5 @@ [assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://github.com/akkadotnet/akka.net")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.Benchmarks")] [assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.Cluster")] [assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.Cluster.Metrics")] [assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.Cluster.Sharding")] diff --git a/src/core/Akka.Remote/Properties/AssemblyInfo.cs b/src/core/Akka.Remote/Properties/AssemblyInfo.cs index 5327178cc1e..5cb60a08b60 100644 --- a/src/core/Akka.Remote/Properties/AssemblyInfo.cs +++ b/src/core/Akka.Remote/Properties/AssemblyInfo.cs @@ -34,3 +34,4 @@ [assembly: InternalsVisibleTo("Akka.Cluster.Tools")] [assembly: InternalsVisibleTo("Akka.Cluster.Sharding")] [assembly: InternalsVisibleTo("Akka.Cluster.Metrics")] +[assembly: InternalsVisibleTo("Akka.Benchmarks")] \ No newline at end of file