IORingGroup's DequeueRioCompletions stackallocs RIORESULT[256] (6144 bytes)
and runs once per game-loop iteration, via NetState.Slice ->
RingSocketManager.ProcessCompletions -> PeekCompletions. The 1.0.8 package was
compiled with the `.locals init` IL flag set, so every one of those calls
memset the full buffer before RIODequeueCompletion overwrote the entries it
actually filled.
An EventPipe profile of a near-idle shard (3 vCPU VPS, world saves off) put
Buffer.ZeroMemoryInternal, called directly from DequeueRioCompletions, at
~2.8% of main-thread samples, and it was the dominant frame in several
60-127 ms game-loop stalls.
Server.dll and UOContent.dll already declare [module: SkipLocalsInit], but
that attribute is a compile-time directive baked into the IL of the assembly
being compiled -- it does not cross assembly boundaries, so it never applied
to the package. IORingGroup 1.0.9 declares it for itself: 158 of its methods
carried `.locals init` before, 0 do now.
Requires IORingGroup 1.0.9 (modernuo/IORingGroup#10).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>