Bug 21920 - Slower build times with larger projects
Summary: Slower build times with larger projects
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.14.0
Hardware: PC Windows
: Normal enhancement
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2014-08-07 12:28 UTC by Jon Douglas [MSFT]
Modified: 2017-11-03 08:05 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Android MSBuild log (3.07 MB, text/plain)
2014-08-07 12:28 UTC, Jon Douglas [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 21920 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Jon Douglas [MSFT] 2014-08-07 12:28:35 UTC
Created attachment 7625 [details]
Android MSBuild log

Somewhat of a continuation of this bug: https://bugzilla.xamarin.com/show_bug.cgi?id=19282

Customer is experiencing 2+ minute build times for Android projects only. The iOS equivalent is quite small in comparison.

Mac

Windows Visual Studio

Windows Xamarin Studio

Cleaned Projects

1:20

1:10

1:10

Build without cleaning

0:05

0:45

0:50


The times are similar whether I've made code changes (trivial ones) to the Android project or not. The PC is more powerful than the Mac (mini), although both have 8GB Ram and SSD drives.

The app was initially created back in January 2013 and I think this was using Xamarin V1 (i.e. Mono for Android). I am now using the latest stable version of Xamarin.

The app references a couple of PCLs (profile 259) which are also used by Windows, Windows Phone and Xamarin.iOS projects.

There are also a couple of projects which contain .jar files. I guess these are Binding Library projects.

Can you suggest anything that is likely to get build times on the PC down to about 5 seconds when the projects have not been cleaned? If not, is there any further information I can provide to help identify the problem?

Xamarin Version Information

https://www.dropbox.com/s/qnbhpt73r9krxp9/Xamarin%20Info.zip

Attached is an Android Diagnostic MSBuild Output log
Comment 1 Jon Stoneman 2014-08-11 10:45:12 UTC
Having updated to the latest stable release, I now have the following approximate build times:

Windows Xamarin Studio: 1:10 for a clean build, 40 seconds if no code changes

Windows Visual Studio: 1:10 for a clean build, skips build if no code changes

Mac: 1:20 for a clean build, 5 seconds if no code changes


Approximate build times for the iOS version of the app when built in Xamarin Studio on the Mac are: 13 seconds for a clean build, 1 second if no code changes.

Version information from Xamarin Studio on Windows is as follows:

Xamarin Studio
Version 5.2 (build 386)
Installation UUID: feb618ca-3c46-42c4-9cee-88f1d34cd602
Runtime:
	Microsoft .NET 4.0.30319.34014
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.25

Xamarin.Android
Version: 4.14.0 (Business Edition)
Android SDK: C:\Users\jon.stoneman\AppData\Local\Android\android-sdk
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.2   (API level 17)
		4.4   (API level 19)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)

Build Information
Release ID: 502000386
Git revision: e6a54dee5376e6e7a2d9982695b060fddc09e65d
Build date: 2014-08-04 14:07:09-04
Xamarin addins: 2b5a5c26ac2ee74c6e91a8d24ef44d0ca9cb74d0

Operating System
Windows 6.2.9200.0 (64-bit)
Comment 2 Przemysław Raciborski 2015-10-09 05:32:41 UTC
I also experience that problems. My build time is up to 5 minutes! every Xamarin version latest stable / latest alpha. I guess that is caused by MultiDex (about 75k methods in my application, google play services, facebook sdk, support libraries and much more)
Comment 3 Jon Douglas [MSFT] 2017-06-28 17:29:20 UTC
I am marking this bug as CONFIRMED as there are many items that can be optimized within the Xamarin.Android build process. There's things out of our control such as large resources going into AAPT and taking awhile. Ideally for anyone running into long build times, please upload a diagnostic build output

https://developer.xamarin.com/guides/android/troubleshooting/troubleshooting/#Diagnostic_MSBuild_Output

This will help diagnose various issues with slow build times in general.
Comment 4 Boris Spinner 2017-11-02 14:53:20 UTC
Regarding "There's things out of our control such as large resources going into AAPT and taking awhile."

you should take a look into resConfigs:

https://bugzilla.xamarin.com/show_bug.cgi?id=40303