Reading through Unity forum threads about slow IL2CPP builds, I noticed people describe a few different problems with the same words. "IL2CPP is slow" can mean very different things, and the fix depends on which one you have.
Before anything else, check that IL2CPP is actually the slow step. A player build also compiles shaders, and one developer on the Unity forums found that 3 to 4 hours of a build lasting over 5 hours was shader variant compilation, not IL2CPP. In the Editor log, the IL2CPP stages show up as "Compiling cpp for libil2cpp" and, on Windows, "Linking GameAssembly.dll".
1. Only the first build is slow
This is normal. Unity's incremental build pipeline reuses work from the previous build, and most of that cache lives in Library/Bee. The first build has nothing to reuse.
So the fix is to keep the cache, not to change settings. On CI, a runner that starts from a fresh checkout pays this cost every time, so persist Library/Bee between runs.
2. Every build is slow
This is the one settings can help with. For builds you iterate on:
- set C++ Compiler Configuration to Debug
- set IL2CPP Code Generation to Optimize for code size and build time
- build only the architecture of your test device
Both settings can make the game run slower, so keep them out of the build you ship. Unity also recommends excluding your project and build folders from antivirus scans and using your fastest disk, since IL2CPP does a lot of reading and writing.
3. Builds were fast and suddenly got slow
This often means the cache stopped being reused and every build is a full rebuild. Things to check:
- a build script or CI job passing
BuildOptions.CleanBuildCache - missing
ScriptsOnlyCache.yamlorDataBuildDirtyInfo.jsoninLibrary/PlayerDataCache - something outside Unity (a cleanup script, a sync tool) touching
Library
Some cases never get explained. In one forum thread where builds went from about 30 seconds to 20 minutes, the reply was that the cache was being cleared and nobody could tell why.
A rough decision flow
If you have hit one of these, which one was it for you?
(I used AI to help me write this up in English.)


