December 20, 2022
Unity Principal Software Engineer Jonas Echterhoff shares how the team has worked to speed up both the script compilation pipeline and the player build pipeline by making them incremental.
February 17, 2022
In Unity 2021, we’ve made a number of improvements to speed things up when using the IL2CPP scripting backend. Let’s take a closer look at some of the key changes that’ll make your code notably faster.
December 15, 2021
Full Generic Sharing allows you to write code that’s more expressive and easier to test. Learn how it eliminates scripting errors and ensures that code on platforms like mobile devices and consoles behave more predictably.
August 11, 2016
Like many programming languages, C# allows the memory for objects to be allocated on the stack (a small, “fast”, scope-specific, block of memory) or the heap (a large, “slow”, global block of memory). Usually allocating space for an object on the heap is much more expensive than ...
August 4, 2016
A virtual method call is a call that must be resolved at run time. The compiler does not know which method will be called when it compiles the code, so it builds an array of methods (called the virtual table, or vtable) for each class. When someone calls one of those methods, the...
July 26, 2016
Modern compilers are excellent at performing many optimizations to improve run time code performance. As developers, we can often help our compilers by making information we know about the code explicit to the compiler. Today we’ll explore one micro-optimization for IL2CPP in som...
December 23, 2015
void Update() {
transform.Translate(0, 0, Time.deltaTime);
}
For an experienced developer this code is a bit odd.
It's not clear how exactly this method is called.
It's not clear in what order these methods are called if you have several objects in a scene.
T...
July 20, 2015
The IL2CPP team has a strong test-first development mentality. Much of the code for IL2CPP is written using the practice of Test Driven Development (TDD), and very few pull requests are merged to the IL2CPP code without significant test coverage. Since IL2CPP has a finite (althou...
July 9, 2015
As with all of the posts in this series, this post deals with implementation details that can and likely will change in the future. In this post we will specifically look at some internal APIs used by the runtime code to communicate with the garbage collector. These APIs are not ...
July 2, 2015
I’ve written a good bit of managed to native interop code in my days, but getting p/invoke declarations right in C# is still difficult, to say the least. Understanding what the runtime is doing to marshal my objects is even more of a mystery. Since IL2CPP does most of its marshal...
June 16, 2015
Note that generic sharing is not a new idea, both Mono and .Net runtimes use generic sharing as well. Initially, IL2CPP did not perform generic sharing. Recent improvements have made it even more robust and beneficial. Since il2cpp.exe generates C++ code, we can see where the met...
June 3, 2015
This is the fourth blog post in the IL2CPP Internals series. In this post, we will look at how il2cpp.exe generates C++ code for method calls in managed code. Specifically, we will investigate six different types of method calls:
Direct calls on instance and static methods
...