Memory changes 3

General memory improvements to decrease GC pressure and frequency.

Pool big arrays and objects that are created and deleted often.

Skip data copies when they aren't needed.

Inline flag checks to skip unneeded allocations.

From my testing the performance is about the same, but the GC frequency is much lower and collection is faster causing less and smaller spikes.
This commit is contained in:
LotP 2025-10-30 20:55:58 -05:00 committed by KeatonTheBot
parent 2c50fbcc1f
commit e3ee28605d
42 changed files with 703 additions and 331 deletions

View file

@ -1,5 +1,6 @@
using Ryujinx.Common.Logging;
using Silk.NET.Vulkan;
using System.Buffers;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
@ -192,6 +193,7 @@ namespace Ryujinx.Graphics.Vulkan
{
_firstHandle = first.ID + 1;
_handles.RemoveAt(0);
ArrayPool<FenceHolder>.Shared.Return(first.Waitable.Fences);
first.Waitable = null;
}
}