Benchmark results and TODOs added / updated
This commit is contained in:
1 parent
507b9c91f4
commit
f9e548279c
31 files changed
+581
-364
No files matched your search
@@ -9,19 +9,23 @@ public class Mod10ULongBenchmarks
|
||||
[Params(3UL, 8191UL, 131071UL, 2147483647UL)]
|
||||
public ulong Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Scalar `% 10` baseline; consistently measured around 0.26 ns (0.2591 ns at value 3, 0.2597 ns at 8191, 0.2605 ns at 131071,
|
||||
/// 0.2598 ns at 2147483647).
|
||||
/// </summary>
|
||||
[Benchmark(Baseline = true)]
|
||||
public ulong LegacyModulo()
|
||||
{
|
||||
return Value % 10UL;
|
||||
return Value % 10UL;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fastest
|
||||
/// </summary>
|
||||
[Benchmark]
|
||||
/// <summary>
|
||||
/// Extension helper that applies the multiply-high mask; 0.73-0.75 ns across the suite (0.7503 ns at value 3, 0.7320 ns at
|
||||
/// 8191, 0.7346 ns at 131071, 0.7411 ns at 2147483647), roughly 2.8-2.9x slower than the raw modulo on `ulong`.
|
||||
/// </summary>
|
||||
[Benchmark]
|
||||
public ulong ModMethodModulo()
|
||||
{
|
||||
return Value.Mod10();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user