You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nothing asserts that sustained concurrent use never triggers a collection #52
AllocationTests.cs measures a single thread calling an operation in a loop. That proves one call is free. It does not prove the collector stays out of the way, which is the claim that actually matters to anyone sizing a service, and it is the claim nothing in the repository tests.
I measured it and the result is better than the README says. Same core chain, ServerGarbageCollection enabled, 200,000 operations per thread:
Threads
Ops
B/op
Gen0
Gen1
Gen2
Mops/s
1
200,000
0.05
0
0
0
77.5
4
800,000
0.00
0
0
0
1,069.5
8
1,600,000
0.00
0
0
0
1,378.0
Zero collections at every generation, and no degradation with thread count. That is the strongest evidence this project has and it appears in neither the README nor the test suite.
What should change
One test, in the same file as the allocation gate:
Two things to get right, because both are how a test like this becomes flaky:
The test host allocates too. Anything else running in the same process during the parallel section can trigger a gen0 and fail the assertion for no reason. Either run it in its own collection with xUnit parallelisation disabled, or assert on GC.GetTotalAllocatedBytes(precise: true) for the measured region and keep the collection count as a looser check.
Server GC is a runtime setting, not a source one. The numbers above are with it enabled. The test project needs <ServerGarbageCollection>true</ServerGarbageCollection> or the thresholds will differ from what CI sees.
Blocked on the allocation budget work landing first, since this belongs in the same file and should share its helpers.
Activity
arnelirobles commentedon Sep 29, 2026
Shipped in 3.0.0 (PR #60, release v3.0.0). PR #60 had
no per-issue closing keywords, so this stayed open.