A mini-announcement about Unity games, performance, and IL2CPP codegen:

https://blog.s-schoener.com/2025-04-07-cpp2better/

IL2CPP, but better | Sebastian Schöner

IL2CPP is Unity’s AOT solution for C#, which takes compiled C# in the form of IL-code and turns it into C++ code, which can then be compiled using regular native toolchains. I have looked at a lot of this generated C++ code and the machine code it compiles to. There...

Sebastian Schöner
@sschoener Sounds really interesting, do you have some examples of the "million small changes" that are made?

@vittorioromeo Mostly changes of the form "don't do unnecessary work." E.g. if I can statically determine that a function call is not necessary, I remove it. That sort of stuff.

The gains come from dealing with things that are inherent to dealing with code that needs to behave as if running in a dotnet environment, not from deep insight into C++ that would be applicable to generic C++ programs.