5.5 has a new compiler does this improve the performance or garbage collection of Unity?

5.5 has a “new compiler” does this improve the performance or garbage collection of Unity?

Has it improved Unity, if so how?

And what now with Unity .Net, C#, IL2CPP, wasm and other language/compiler improvements/advances?

Did Unity provide a in depth roadmap of what’s on the way or coming soon?

I wouldn’t think so. GC is handled by the runtime. It may do a better job of some inlining and code optimization wich would (slightly) improve performance and memory usage but wouldn’t impact the GC.

The .NET 4.6 beta for the Unity Editor though should be a good indication of work and progress being made. That will be a significant update once the Engine utilizes it and will result in a newer runtime and better GC as well.

There is mention of performance in the release notes. :stuck_out_tongue:

3 Likes

If memory serves, the main benefits at the moment are from fewer allocations. Foreach and coroutines shouldn’t have allocations like before.

1 Like

Yep, better IL generation.

No you can still do crazy allocation overheads in loops and don’t care of your memory allocation. You can still make bad codes…

As @Dustin-Horne says - the new compiler can generate better IL than before in some situations (a mix of more optimized instructions + using newer instructions that weren’t fully implemented in the older compiler), which means those situations might execute faster or with fewer allocations than before.

And as @Ironmax says, it is also still possible to write very bad code that even the new compiler cannot help you with :slight_smile:

4 Likes

No compiler will stop you writing bad code…

1 Like