Here I can see that Unity documentation says that it is 50% slower than native code: http://docs.unity3d.com/412/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html
Here it says that there is an IL2CPP compiler, that obtains c++ code which is compiled into native code. So is it now creating native code, or is it 50% slower? :) http://blogs.unity3d.com/2015/05/06/an-introduction-to-ilcpp-internals/ http://blogs.unity3d.com/2014/05/20/the-future-of-scripting-in-unity/
New syntax and language features. Using the updated scripting runtime gives Unity developers access to C# 8 and a host of new language features and syntax.
Unity support for C# 8 has started on version 2020.2 and C# 9 has started on version 2021.2. Be aware that not every C# 8 and 9 feature is supported by Unity, like: default interface methods. indices and ranges.
Unity Technologies Unity doesn't use the Visual Studio compiler, it has its own.
To compile C# source code in a Unity Project, the Unity Editor uses a C# compiler. The Editor passes a default set of options to the C# compiler. To pass additional options in your project, see the documentation for Platform Dependent Compilation.
The documentation from Unity you referenced is pretty old, and even at the time it is written, I would really wonder about those performance numbers. In general, performance is much more complex to measure and report than one number like 50% can express.
If you want to learn more about IL2CPP, check out this blog post series.
Based on our benchmarks at Unity, we're seeing better performance for script-bound code with IL2CPP than with the Unity version of Mono. You can find one benchmark we have published here.
There are a few caveats to keep in mind though:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With