Incremental AOT? RRS feed

  • Question

  • User277 posted

    Are there any options for improving the performance of incremental AOT builds? It seems that no matter how small the change, everything gets AOT'd every single compile. Due to some hardware constraints, running in the simulator isn't viable for us, so we need to deploy to the device each time. With ~300k loc, this is a bit painful (2-3min on a fairly recent MBP). We are using MT 6.0.7 and MD 3.1.1.

    Any suggestions greatly appreciated.

    Monday, December 17, 2012 4:07 PM

All replies

  • User34 posted

    MonoTouch 5.4 introduced object file (.o) caching. You can try it timing the following:

    1. Select Debug|Device or Release|Device;
    2. Rebuild your solution;
    3. Do a whitespace change in your AppDelegate.cs;
    4. Build the solution again

    You should notice a big difference in time.

    Now the object caching depends on the assemblies (.dll/.exe) themselves. Since the linker will change them very often some the cache is, sadly, often discarded.

    E.g. a common case is then adding a call that requires a new method from mscorlib.dll. Since everything depends on mscorlib then the whole cache will be discarded.

    Turning off the linker does not really help. While the cache won't be flush so often (a good thing) it requires a lot more AOT time (bad) and also more time to upload those larger binaries to the devices (bad again).

    Testing has shown it's faster to link without caching than not linking with caching. Of course you get, by default, better by using linking and caching (the worse case is no build time gain).

    Speaking of linking you might want to enable "Link all" on your project. For the same reasons as above (it's faster to remove code by linking than AOT'ing the extra code) you'll likely get faster builds.

    Also if you application contains a lot of (non code) assets you should take a look at http://blog.xamarin.com/2012/12/17/handling-large-assets-on-ios/ It might not build faster - but you'll get debugging your application faster :-)

    Tuesday, December 18, 2012 12:48 AM
  • User277 posted

    Thanks for the suggestions Sebastien, but even a simple whitespace change in a file results in a 2+ minute build. Are there any other things we can try, such as any mtouch switches that might help things out?

    Thursday, December 20, 2012 1:35 AM
  • User34 posted

    The default settings for projects where selected to get you the fastest build possible.

    I suggest you to look at this stackoverflow question/answer to see if any of your own (modified/added) settings can influence your build time.

    Beside that you might want to give us (thru support) a build log of your solution where you include -v -v -v --time --time in the "extra mtouch arguments". We'll have a look at it... can't promise miracles but if there's something really wrong we should be able to spot it from the log.

    Thursday, December 20, 2012 2:20 AM
  • User149548 posted

    @poupou said: The default settings for projects where selected to get you the fastest build possible.

    In other words, No there is nothing more Xamarin can do about their awful build times

    Friday, August 26, 2016 6:26 PM