Skip to content

Commit 103750f

Browse files
authored
Add benchmarks for GetCurrentHashAsUInt32 and GetCurrentHashAsUInt64. (#3530)
1 parent 364afbf commit 103750f

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/benchmarks/micro/libraries/System.IO.Hashing/Crc32_GetCurrentHashPerf.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,12 @@ namespace System.IO.Hashing.Tests
88
{
99
public class Crc32_GetCurrentHashPerf : Crc_GetCurrentHashPerf<Crc32>
1010
{
11+
#if NET8_0_OR_GREATER
12+
[Benchmark]
13+
public uint GetCurrentHashAsUInt32()
14+
{
15+
return Crc.GetCurrentHashAsUInt32();
16+
}
17+
#endif
1118
}
1219
}

src/benchmarks/micro/libraries/System.IO.Hashing/Crc64_GetCurrentHashPerf.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,12 @@ namespace System.IO.Hashing.Tests
88
{
99
public class Crc64_GetCurrentHashPerf : Crc_GetCurrentHashPerf<Crc64>
1010
{
11+
#if NET8_0_OR_GREATER
12+
[Benchmark]
13+
public ulong GetCurrentHashAsUInt64()
14+
{
15+
return Crc.GetCurrentHashAsUInt64();
16+
}
17+
#endif
1118
}
1219
}

0 commit comments

Comments
 (0)