Add TODOs for divisor metadata caching

This commit is contained in:
Marek Lemańczyk committed 2025-10-01 22:52:21 +02:00
1 parent 513fc7acb0
commit 36d316d19c
53 files changed
+929 -393

No files matched your search

@@ -32,6 +32,12 @@ public class MontgomeryMultiplyBenchmarks
}
}
/// <summary>
/// Baseline Montgomery multiply used in earlier revisions; measured 247 ns (64 batch), 974 ns (256), and 3.94 μs (1024).
/// </summary>
/// <remarks>
/// Observed means: BatchSize 64 → 247.0 ns (1.00×), 256 → 974.2 ns, 1024 → 3,940.6 ns.
/// </remarks>
[Benchmark(Baseline = true)]
public ulong OriginalImplementation()
{
@@ -44,6 +50,12 @@ public class MontgomeryMultiplyBenchmarks
return checksum;
}
/// <summary>
/// Optimized Montgomery multiply; consistently 3–5% faster with 234.9 ns (64), 942.6 ns (256), and 3.75 μs (1024).
/// </summary>
/// <remarks>
/// Observed means: BatchSize 64 → 234.9 ns (0.95×), 256 → 942.6 ns, 1024 → 3,751.6 ns.
/// </remarks>
[Benchmark]
public ulong OptimizedImplementation()
{