-
Notifications
You must be signed in to change notification settings - Fork 1k
/
AddressBenchmarks.cs
57 lines (49 loc) · 1.47 KB
/
AddressBenchmarks.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//-----------------------------------------------------------------------
// <copyright file="AddressBenchmarks.cs" company="Akka.NET Project">
// Copyright (C) 2009-2022 Lightbend Inc. <http://www.lightbend.com>
// Copyright (C) 2013-2022 .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 AddressBenchmarks
{
private Address x;
private Address y;
[GlobalSetup]
public void Setup()
{
x = new Address("akka.tcp", "test-system", "10.62.0.101", 4000);
y = new Address("akka.tcp", "test-system", "10.62.0.101", 4123);
}
[Benchmark]
public Address Address_Parse()
{
return Address.Parse("akka.tcp://test-system@10.62.0.100:5000/");
}
[Benchmark]
public int Address_CompareTo()
{
return x.CompareTo(y);
}
[Benchmark]
public string Address_ToString()
{
return x.ToString();
}
[Benchmark]
public bool Address_Equals()
{
return x == y;
}
[Benchmark]
public int Address_GetHashCode()
{
return x.GetHashCode();
}
}
}