From ea73e39d6c5e4709739233d848718da2d6e366db Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Tue, 4 Aug 2026 19:54:49 -0700 Subject: [PATCH] perf(network): consume IORingGroup 1.0.9 to drop the per-iteration 6 KiB memset 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) --- Projects/Server/Server.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Server/Server.csproj b/Projects/Server/Server.csproj index 8953efcba..b022c584c 100644 --- a/Projects/Server/Server.csproj +++ b/Projects/Server/Server.csproj @@ -34,7 +34,7 @@ - +