test(ci): harden scheduling and allocation gates
This commit is contained in:
parent
c4608b1127
commit
d123c4b67c
11 changed files with 101 additions and 87 deletions
|
|
@ -71,10 +71,9 @@ public class CellViewDedupTests
|
|||
|
||||
// Warm the method/JIT before measuring. Duplicate portal emissions are the hot path.
|
||||
Assert.False(view.Add(polygon));
|
||||
long before = GC.GetAllocatedBytesForCurrentThread();
|
||||
for (int i = 0; i < 1_000; i++)
|
||||
Assert.False(view.Add(polygon));
|
||||
long allocated = GC.GetAllocatedBytesForCurrentThread() - before;
|
||||
long allocated = ZeroAllocationProbe.MeasureWarmed(
|
||||
() => _ = view.Add(polygon),
|
||||
batchSize: 1_000);
|
||||
|
||||
Assert.True(allocated <= 256, $"duplicate probes allocated {allocated:N0} bytes");
|
||||
}
|
||||
|
|
@ -91,13 +90,13 @@ public class CellViewDedupTests
|
|||
view.Reset();
|
||||
Assert.True(view.Add(polygon));
|
||||
|
||||
long before = GC.GetAllocatedBytesForCurrentThread();
|
||||
for (int i = 0; i < 1_000; i++)
|
||||
{
|
||||
view.Reset();
|
||||
Assert.True(view.Add(polygon));
|
||||
}
|
||||
long allocated = GC.GetAllocatedBytesForCurrentThread() - before;
|
||||
long allocated = ZeroAllocationProbe.MeasureWarmed(
|
||||
() =>
|
||||
{
|
||||
view.Reset();
|
||||
_ = view.Add(polygon);
|
||||
},
|
||||
batchSize: 1_000);
|
||||
|
||||
Assert.True(allocated <= 256, $"steady rebuilds allocated {allocated:N0} bytes");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue