1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-19 03:26:39 +00:00
Ryujinx/Ryujinx.HLE/HOS/Services/Audio
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
..
AudioIn Rename Hipc to Cmif where appropriate (#3880) 2023-04-14 20:00:34 -03:00
AudioOut Rename Hipc to Cmif where appropriate (#3880) 2023-04-14 20:00:34 -03:00
AudioRenderer Reducing Memory Allocations 202303 (#4624) 2023-04-24 02:06:23 +00:00
HardwareOpusDecoderManager Rename Hipc to Cmif where appropriate (#3880) 2023-04-14 20:00:34 -03:00
Types Removed unused usings. (#3593) 2022-08-18 18:04:54 +02:00
AudioInManager.cs Haydn: Part 1 (#2007) 2021-02-26 01:11:56 +01:00
AudioInManagerServer.cs Rename Hipc to Cmif where appropriate (#3880) 2023-04-14 20:00:34 -03:00
AudioOutManager.cs UI - Add Volume Controls + Mute Toggle (F2) (#2871) 2021-12-23 13:33:56 -03:00
AudioOutManagerServer.cs Rename Hipc to Cmif where appropriate (#3880) 2023-04-14 20:00:34 -03:00
AudioRendererManager.cs Allocate work buffer for audio renderer instead of using guest supplied memory (#3276) 2022-09-10 01:16:24 +00:00
AudioRendererManagerServer.cs Rename Hipc to Cmif where appropriate (#3880) 2023-04-14 20:00:34 -03:00
IAudioController.cs Refactoring HOS folder structure (#771) 2019-09-19 10:45:11 +10:00
IAudioInManager.cs Haydn: Part 1 (#2007) 2021-02-26 01:11:56 +01:00
IAudioInManagerForApplet.cs Refactoring HOS folder structure (#771) 2019-09-19 10:45:11 +10:00
IAudioInManagerForDebugger.cs Refactoring HOS folder structure (#771) 2019-09-19 10:45:11 +10:00
IAudioOutManager.cs UI - Add Volume Controls + Mute Toggle (F2) (#2871) 2021-12-23 13:33:56 -03:00
IAudioOutManagerForApplet.cs Refactoring HOS folder structure (#771) 2019-09-19 10:45:11 +10:00
IAudioOutManagerForDebugger.cs Refactoring HOS folder structure (#771) 2019-09-19 10:45:11 +10:00
IAudioRendererManager.cs Amadeus: Final Act (#1481) 2020-08-17 22:49:37 -03:00
IAudioRendererManagerForApplet.cs Refactoring HOS folder structure (#771) 2019-09-19 10:45:11 +10:00
IAudioRendererManagerForDebugger.cs Refactoring HOS folder structure (#771) 2019-09-19 10:45:11 +10:00
IAudioSnoopManager.cs Refactoring HOS folder structure (#771) 2019-09-19 10:45:11 +10:00
IFinalOutputRecorderManager.cs Refactoring HOS folder structure (#771) 2019-09-19 10:45:11 +10:00
IFinalOutputRecorderManagerForApplet.cs Refactoring HOS folder structure (#771) 2019-09-19 10:45:11 +10:00
IFinalOutputRecorderManagerForDebugger.cs Refactoring HOS folder structure (#771) 2019-09-19 10:45:11 +10:00
IHardwareOpusDecoderManager.cs Rename Hipc to Cmif where appropriate (#3880) 2023-04-14 20:00:34 -03:00
ResultCode.cs Add various error codes to Audio (#1201) 2020-05-03 22:45:22 +02:00