Skip to content

Commit fa92fed

Browse files
authored
Add Perf_Guid::EqualsNotSame benchmark (#2324)
1 parent 05d60a5 commit fa92fed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/benchmarks/micro/libraries/System.Runtime/Perf.Guid.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ namespace System.Tests
1111
public class Perf_Guid
1212
{
1313
const string guidStr = "a8a110d5-fc49-43c5-bf46-802db8f843ff";
14+
const string guid2Str = "86A96B5D-F9B2-4CB5-B531-FC7021FA99D7";
1415

1516
private readonly Guid _guid;
1617
private readonly Guid _same;
18+
private readonly Guid _guid2;
1719
private readonly byte[] _buffer;
1820

1921
public Perf_Guid()
2022
{
2123
_guid = new Guid(guidStr);
2224
_same = new Guid(guidStr);
25+
_guid2 = new Guid(guid2Str);
2326
_buffer = _guid.ToByteArray();
2427
}
2528

@@ -35,6 +38,9 @@ public Perf_Guid()
3538
[Benchmark]
3639
public bool EqualsSame() => _guid.Equals(_same);
3740

41+
[Benchmark]
42+
public bool EqualsNotSame() => _guid.Equals(_guid2);
43+
3844
[Benchmark]
3945
public bool EqualsOperator() => _guid == _same;
4046

0 commit comments

Comments
 (0)