0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.HLE/HOS/Services/SurfaceFlinger
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
..
Types Removed unused usings. (#3593) 2022-08-18 18:04:54 +02:00
BufferItemConsumer.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
BufferQueue.cs Refactor CPU interface to allow the implementation of other CPU emulators (#3362) 2022-05-31 16:29:35 -03:00
BufferQueueConsumer.cs Improved Logger (#1292) 2020-08-04 01:32:53 +02:00
BufferQueueCore.cs Refactor CPU interface to allow the implementation of other CPU emulators (#3362) 2022-05-31 16:29:35 -03:00
BufferQueueProducer.cs Refactor CPU interface to allow the implementation of other CPU emulators (#3362) 2022-05-31 16:29:35 -03:00
BufferSlot.cs SurfaceFlinger: fix some bugs (#1262) 2020-06-02 17:58:19 +02:00
BufferSlotArray.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
ConsumerBase.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
HOSBinderDriverServer.cs Improved Logger (#1292) 2020-08-04 01:32:53 +02:00
IBinder.cs Improved Logger (#1292) 2020-08-04 01:32:53 +02:00
IConsumerListener.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
IFlattenable.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
IGraphicBufferProducer.cs Improved Logger (#1292) 2020-08-04 01:32:53 +02:00
IHOSBinderDriver.cs Reducing Memory Allocations 202303 (#4624) 2023-04-24 02:06:23 +00:00
IProducerListener.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
LayerState.cs Fix Vi managed and stray layers open/close/destroy (#3438) 2022-07-06 13:37:36 -03:00
NativeWindowApi.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
NativeWindowAttribute.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
NativeWindowScalingMode.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
NativeWindowTransform.cs SurfaceFlinger: fix some bugs (#1262) 2020-06-02 17:58:19 +02:00
Parcel.cs Added Generic Math to BitUtils (#3929) 2022-12-26 14:11:05 +00:00
ParcelHeader.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
PixelFormat.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
Status.cs SurfaceFlinger v2 (#981) 2020-04-22 14:10:27 +10:00
SurfaceFlinger.cs Allow Surface Flinger frame enqueue after process has exited (#3733) 2022-10-02 21:50:03 +00:00