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

@@ -39,6 +39,13 @@ public class GpuUInt128MulModBenchmarks
public static IEnumerable<MulModInput> GetInputs() => Inputs;
/// <summary>
/// In-place multiply-modulo; great for low-word-heavy operands (6.88 ns) and tiny pairs (7.15 ns) but notably slower on
/// large moduli (193–201 ns).
/// </summary>
/// <remarks>
/// Observed means: HighWordModulus 192.794 ns (1.00×), LowWordHeavy 6.883 ns, MixedMagnitude 201.468 ns, TinyOperands 7.146 ns.
/// </remarks>
[Benchmark(Baseline = true)]
public GpuUInt128 InPlaceMulMod()
{
@@ -48,6 +55,13 @@ public class GpuUInt128MulModBenchmarks
return value;
}
/// <summary>
/// Allocates fresh temporaries per iteration; pays off on every dataset with 4.66 ns on tiny operands, 117 ns on
/// low-word-heavy inputs, 138 ns on mixed magnitude, and 184 ns on high-word moduli.
/// </summary>
/// <remarks>
/// Observed means: HighWordModulus 184.322 ns (0.96×), LowWordHeavy 116.993 ns, MixedMagnitude 138.684 ns, TinyOperands 4.659 ns.
/// </remarks>
[Benchmark]
public GpuUInt128 AllocatePerIteration()
{