Merge gRPC data perf harness (#1094 test item): per-thread publish-path allocation sections, counter-based wait instead of copying polls

This commit is contained in:
Joseph Doherty
2026-12-04 14:38:16 -05:00
5 changed files with 116 additions and 7 deletions
@@ -58,6 +58,8 @@ internal sealed partial class DataSubscriptionSession : IDataSubscriptionTranspo
internal Action? SnapshotEndCommittedForTests { get; set; }
internal Action<int, int, int>? BeforeDirtyTickForTests { get; set; }
internal Action? AfterTickForTests { get; set; }
/// <summary>#1094: runs on the worker as a tick starts, so a harness can attribute the thread's allocations to the tick.</summary>
internal Action? BeforeTickForTests { get; set; }
/// <summary>Test seam: a frame met a full delivery window (the worker is about to wait for the reader).</summary>
internal Action? OutboundFullForTests { get; set; }
internal Action<DataItemHandle, long>? OnCandidateQueuedForTests { get; set; }
@@ -811,6 +813,7 @@ internal sealed partial class DataSubscriptionSession : IDataSubscriptionTranspo
[AsyncMethodBuilder(typeof(PoolingAsyncValueTaskMethodBuilder))]
private async ValueTask TickAsync()
{
BeforeTickForTests?.Invoke();
try
{
lock (_gate)