Search Unity

Android IL2CPP build times really slow

Discussion in '5.5 Beta' started by bdovaz, Nov 12, 2016.

  1. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    676
    How can be possible that an EMPTY project needs 13 minutes to build an apk? And on mono2x it's 1 minute or less.

    I was trying it on my Jenkins pipeline and I'm going to switch back to mono2x.

    Really you need to optimize it because if you don't do it, developers are not going to make the transition from mono2x to il2cpp.

    Are you working on IL2CPP incremental builds? It's not acceptable that you change one line of code and you need to wait 13 minutes on an EMPTY project.
     
    salahtalbi083 and elnineo like this.
  2. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I think this been discussed before, see if you can search for topics...
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,452
    What hardware are you running on? 13 minutes sounds excessive, and I haven't seen it to be that bad. We have incremental build support - does it not work for you?

    One thing I saw help tremendously was having both target build directory and the project directory on an SSD. In my experience, that makes build times up to 4 times faster.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,452
    Other 2 things to check:

    1. Do you have any anti virus software running? Some of them slow down IL2CPP code generation (writing of C++ files) and then compiling them a lot - in my testing, disabling windows defender gave a huge speed up.

    2. For development, make sure to build for ARMv7 only rather than FAT (ARMv7 + x86). That will shave off compilation time in half.
     
  5. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    102
    I just updated my project to 5.5.0b11 from 5.3.6p8 and I too have noticed that Android IL2CPP takes at least twice as long (just gut feeling not actual measurement) than it used to. iOS seems about the same. I was an early adopter of Android IL2CPP even back when it was experimental, so I think I've done enough builds of my project to get a feeling for how long they should take. My system is a Quad-Core Macbook Pro with SSD.
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,452
    Are you building ARMv7 or FAT packages?
     
  7. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    102
    Only ARMv7, I haven't tested my app on Chromebooks yet, so I always remove x86.
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,452
    Any chance you could do a real measurement? If you find that there's compilation time regression, we'll look at it.
     
  9. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    792
    I also go that feeling, early adopter here too. Josh told me you didn't change anything on that regard but I seem to recall it was faster on small project before. The second compilation instead is obviously much faster now since it's reusing object files.
    I think the slowness of the first pass got introduced with the new partial compilation.
     
  10. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    102
    Doesn't 5.5 also update the C# compiler or is that coming in 5.6?
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,452
    It does - that has little to do with il2cpp build times, though.