Skip to content

Commit

Permalink
added FastHash benchmark (#5029)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb authored May 21, 2021
1 parent aa8a3de commit 5294e9a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/benchmark/Akka.Benchmarks/Remoting/FastHashBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Original file line number Diff line number Diff line change
@@ -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")]
Expand Down
1 change: 1 addition & 0 deletions src/core/Akka.Remote/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@
[assembly: InternalsVisibleTo("Akka.Cluster.Tools")]
[assembly: InternalsVisibleTo("Akka.Cluster.Sharding")]
[assembly: InternalsVisibleTo("Akka.Cluster.Metrics")]
[assembly: InternalsVisibleTo("Akka.Benchmarks")]

0 comments on commit 5294e9a

Please sign in to comment.