Hacker News new | ask | show | jobs
by ccvannorman 2718 days ago
Can you expand on "knowing how to work with the GC" in Unity? I'm a Unity dev and rarely touch GC other than keeping mindful of the work I'm giving it by size/quantity of objects in my scene/making sure objects are dereferenced/can be collected.
1 comments

Basically, know what does and doesn't allocate heap memory, don't give the GC more work than it can handle and measure on the target hardware. Do it right at the start of development and consider things like object pooling and the new ECS, if necessary. Understand how your GC works: https://blogs.unity3d.com/2018/11/26/feature-preview-increme...

It's not about performance in 99% of frames, it's about not dropping frames when the GC kicks in and needs more time than your budget accounts for.