Unity - current version generate native code or not?

Here I see that the Unity documentation says that it is 50% slower than the native code: http://docs.unity3d.com/412/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html

It says that there is an IL2CPP compiler that receives C ++ code that is compiled into native code. So now he creates his own 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 /

+6
source share
1 answer

The documentation from Unity that you referenced is quite old, and even while it is being written, I really wonder about these performance metrics. In general, performance is much more difficult to measure and report than can express a single number, for example, 50%.

If you want to know more about IL2CPP, check out this blog post .

Based on our tests for Unity, we see better performance for script-limit code with IL2CPP than with the Unity Mono version. You can find one test that we published here .

There are a few caveats to keep in mind:

  • Unity uses the old version of the Mono runtime (circa 2011). Newer versions are better - and we are now working on updating the runtime.
  • In most games, the code is not script -bound, it is usually associated with the GPU.
  • The generated C ++ code still provides security for the managed language, so it, for example, checks the boundaries of the array.
  • The performance difference between Mono AOT and IL2CPP compilers will vary by platform. On some platforms, the Mono AOT compiler generates machine code as well as a C ++ compiler. On other platforms, this is not the case.
+9
source

All Articles