top | item 18878652

(no title)

galacticpony2 | 7 years ago

It's not about the language, C# is generally fine if you know how to work the GC (which admittedly many people don't). The kind of C++ that is used for game code in UE4 isn't exactly "zero-overhead" either and it also uses garbage collection. Plus, on mobile C# in Unity is translated to C++ anyway. My guess is that the difference is negligible in most cases.

What really makes the difference is that Unity has light-weight rendering pipelines available, running on older GPUs. UE4 just ditches those devices.

discuss

order

ccvannorman|7 years 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.

galacticpony2|7 years ago

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.