Ryujinx/Ryujinx.HLE/HOS/Kernel/SupervisorCall
jhorv 666e05f5cb
Reducing Memory Allocations 202303 (#4624)
* use ArrayPool, avoid 6000-7000 allocs/sec of runtime

* use ArrayPool, avoid ~7k allocs/second during game execution

* use ArrayPool, avoid ~3000 allocs/sec during game execution

* use MemoryPool, reduce 0.5 MB/sec of new allocations during game execution

* avoid over-allocation by setting List<> Capacity when known

* remove LINQ in KTimeManager.UnscheduleFutureInvocation

* KTimeManager - avoid spinning one more time when the time has arrived

* KTimeManager - let SpinWait decide when to Thread.Yield(), and don't SpinOnce() immediately after Thread.Yield()

* use MemoryPool, reduce ~175k bytes/sec allocation during game execution

* IpcService - call commands via dynamic methods instead of reflection .Invoke(). Faster to call and with fewer allocations because parameters can be passed directly instead of as an array

* Make ButtonMappingEntry a record struct to avoid allocations. Set the List<ButtonMappingEntry> capacity according to use.

* add MemoryBuffer type for working with MemoryPool<byte>

* update changes to use MemoryBuffer

* make parameter ReadOnlySpan instead of Span

* whitespace fix

* Revert "IpcService - call commands via dynamic methods instead of reflection .Invoke(). Faster to call and with fewer allocations because parameters can be passed directly instead of as an array"

This reverts commit f2c698bdf65f049e8481c9f2ec7138d9b9a8261d.

* tweak KTimeManager spin behavior

* replace MemoryBuffer with ByteMemoryPool modeled after System.Buffers.ArrayMemoryPool<T>

* make ByteMemoryPoolBuffer responsible for renting memory
2023-04-24 02:06:23 +00:00
..
CodeMemoryOperation.cs Implement code memory syscalls (#2958) 2022-05-03 13:16:31 +02:00
InfoType.cs Add InfoType.MesosphereCurrentProcess (#3792) 2022-12-04 19:46:02 +00:00
MemoryInfo.cs kernel: A bit of refactoring and fix GetThreadContext3 correctness (#3042) 2022-01-29 22:18:03 +01:00
PointerSizedAttribute.cs Rewrite SVC handler using source generators rather than IL emit (#3371) 2022-05-31 17:12:46 -03:00
SvcAttribute.cs Rewrite SVC handler using source generators rather than IL emit (#3371) 2022-05-31 17:12:46 -03:00
SvcImplAttribute.cs Rewrite SVC handler using source generators rather than IL emit (#3371) 2022-05-31 17:12:46 -03:00
Syscall.cs Reducing Memory Allocations 202303 (#4624) 2023-04-24 02:06:23 +00:00
SyscallHandler.cs Rewrite SVC handler using source generators rather than IL emit (#3371) 2022-05-31 17:12:46 -03:00
ThreadContext.cs kernel: A bit of refactoring and fix GetThreadContext3 correctness (#3042) 2022-01-29 22:18:03 +01:00