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) <noreply@anthropic.com>
This commit is contained in:
Kamron Batman 2026-08-04 19:54:49 -07:00
parent aae173a797
commit ea73e39d6c
No known key found for this signature in database
GPG key ID: 7D81DF26D9A5D94A

View file

@ -34,7 +34,7 @@
</Target>
<ItemGroup>
<ProjectReference Include="..\Logger\Logger.csproj" />
<PackageReference Include="IORingGroup" Version="1.0.8" />
<PackageReference Include="IORingGroup" Version="1.0.9" />
<PackageReference Include="CommunityToolkit.HighPerformance" Version="8.4.2" />
<PackageReference Include="LibDeflate.Bindings" Version="1.0.3" />
<PackageReference Include="System.IO.Hashing" Version="10.0.10" />