The process of converting .NET assemblies into C++ files has historically been single threaded. The il2cpp.exe utility performs this task… You may have noticed the il2cpp.exe process churning along using a single core.
In the fall of 2019 we began a journey to make il2cpp.exe take advantage of all the cores your machine has available. Over the last year we have steadily shifted il2cpp.exe toward becoming a multi-threaded application.
Starting in 2020.2.0b2 the process of converting .NET assemblies into C++ files is multi-threaded.
For 6-8 core machines the conversion process will see roughly a 60-65% decrease in conversion time. On a 64 core machine conversion time decreased by 73%.
It is hard to generalize exactly what improvement you will see in the overall il2cpp player build times. There are many variables that contribute to the total player build time such as C++ compiler settings, your CPU, and more.
Broadly speaking here is what you can expect to see
Clean player builds will have the least perceived improvement. This is because compiling C++ files dominates the total time.
Incremental player builds will see the most perceived benefit because there are fewer C++ files to compile.
Are C++ files regenerated for all assemblies all the time or only the assemblies that changed?
If it is regenerated for all, do you plan to improve this?
Oh looking forward to this. I don’t have cloud build or anything so this might move IL2CPP back into the realm of iteration viability. We’ll see, but I hope so .
My build times went from >3 minutes to 2:40 minutes (or 19 seconds when no code change). Nice!
Observation… when looking at CPU utilisation during IL2CPP conversion my CPU is barely utilized by 10% (R9 3900x 12c/24t). So I do have build time improvements but I don’t think it’s from that specific feature. Is it supposed to heavily multi-thread the process or is it light?
Isn’t Unity only building assets that end up in the build already? Can’t you use the “Compress assets on import” option in the preferences to basically have zero asset compression time in the editor?
Compress on import compresses all the textures in the project, ( making the cache data base very large ) and when switching platforms it needs to compress all the textures for that platform, making switching platforms taking a long time.
I would like to make a build and then unity checks what textures are needed and only compresses those, saving disk space and time.
And ideally do it on the GPU to speed up compression time.
Right now it can take many hours and gigabytes to compress all the textures in my project but I don’t even need them all compressed