perf(worker): memoize event frame size at enqueue; drain stops sizing under the STA's lock
This commit is contained in:
@@ -541,7 +541,11 @@ is bounded on **two** axes because no diagnostics command may be session-fatal:
|
||||
maximum less a 64 KiB envelope/reply-wrapper reserve, and the size decision
|
||||
happens inside the event queue's lock, so an event is dequeued only once it is
|
||||
known to fit. An event that does not fit stays at the head of the queue and is
|
||||
never lost.
|
||||
never lost. Each event's serialized size is *measured* once at enqueue, outside
|
||||
that lock, and stored beside it: the drain only compares memoized numbers, so a
|
||||
large drain never walks messages under the lock the STA needs to enqueue the
|
||||
next COM callback. The memoized size cannot go stale because an enqueued event
|
||||
is never mutated again (WRK-11).
|
||||
|
||||
Truncation is reported in the reply's existing `DiagnosticMessage`
|
||||
("N events returned, M remain; repeat DrainEvents for the rest") rather than in a
|
||||
|
||||
Reference in New Issue
Block a user