News for hackers. Stuff that matters.
Re:ProjectPSX – A C# coded emulator of the original Playstation by jayd16 on Monday September 09, 2019 @11:43AM (#20919186)
Search the repo for "new" and you'll see that everything is allocated at construction time. Everything hangs off the window class so essentially all memory is allocated as the project starts up. You'd probably want to pre-allocate in any language because but this also relieves GC pressure.

Another thing you can do in C# is leverage stack allocation using structs.

Re:ProjectPSX – A C# coded emulator of the original Playstation by WorldMaker on Monday September 09, 2019 @05:48PM (#20922837)
Relatedly, the new .NET Span<T> APIs open up a lot more opportunities for stack allocation and "pointer arithmetic-style" work in "safe" code. Span<T> is really fascinating at the performance opportunities it opens in .NET (and real performance gains already achieved in, for instance, ASP.NET Core).