Just in time compilation

There is yet another way to run code, using what's called a just in time compiler, or JIT for short. A JIT caches the instructions, that have been previously interpreted to machine code, and reuses those native machine code instructions thus saving time and resources by not having to re-interpret statements that have already been interpreted.

Visually, it looks similar to this:

Now, Unity uses a JIT and AOT compiler to convert code into machine code, which can then be read by the machine. The first time that a function is called, the game will convert that code into machine language and then the next time it is called, it will go directly to the translated code, so you only need to do conversions to things that are happening. Due to this happening at runtime, this may cause your project to lag when using a lot of new things.

A great talk about how scripting works inside of the Unity game engine can be found here: https://www.youtube.com/watch?v=WE3PWHLGsX4.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.223.10