Bug 22681 - Builds of multiple iOS projects take much longer with Xamarin 3.5.5
Summary: Builds of multiple iOS projects take much longer with Xamarin 3.5.5
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS (show other bugs)
Version: 3.5
Hardware: PC Windows
: Normal normal
Target Milestone: 4.0.1 (C6SR1)
Assignee: Jose Gallardo
URL:
Depends on:
Blocks:
 
Reported: 2014-09-05 05:42 UTC by Frank Buckley
Modified: 2015-11-11 10:19 UTC (History)
13 users (show)

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


Attachments
Example solution (86.39 KB, application/x-zip-compressed)
2014-09-05 05:42 UTC, Frank Buckley
Details
VS and MTB Server logs (21.02 KB, application/x-zip-compressed)
2014-09-05 05:43 UTC, Frank Buckley
Details
VS and XS version info (2.92 KB, application/x-zip-compressed)
2014-09-05 05:45 UTC, Frank Buckley
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 on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Frank Buckley 2014-09-05 05:42:39 UTC
Created attachment 7942 [details]
Example solution

We have a solution with many (>160) IOS, Android, Windows and WinRT projects, with a variety of shared class libraries, linked source files, etc.

After installing the latest stable builds (Xamarin 3.5.55, Xamarin.iOS 7.4.0.108), our solution builds have slowed from a few minutes to sometimes approaching half an hour.

This seems to be related to building iOS projects and the build server log shows significant delays with some requests during the build process.

I have built a simple test solution with some of the same features as our main solution and this exhibits similar behaviour - albeit on a smaller (and shorter) scale.
Comment 1 Frank Buckley 2014-09-05 05:43:34 UTC
Created attachment 7943 [details]
VS and MTB Server logs
Comment 2 Frank Buckley 2014-09-05 05:45:51 UTC
Created attachment 7944 [details]
VS and XS version info
Comment 3 Frank Buckley 2014-09-06 07:39:20 UTC
I am informed this is by design: to support incremental builds, every build is fully built on the build server, rather than many taking place only locally until they are actually deployed for debugging.

However, if you have several iOS apps in a solution, the penalty for this is severe - I am seeing build times for 17 iOS apps in a solution go from 1-2 minutes to 15 minutes.

Moreover, I do not have incremental builds turned on for any projects.

Obviously, a workaround is to avoid building all the app projects whenever possible. However, if you have code shared across them (we do) and you are working on this common code, you often cause all the app projects to build. A further workaround would be just to build one selected app, but then you are not checking if your code changes will cause a compilation error in one of the other apps.

Surely the considerable cost of supporting incremental builds in this way should be something we can choose to accept or not?
Comment 4 Jose Gallardo 2014-09-08 13:45:35 UTC
Hi Frank,

First of all, I'm really sorry for all the inconvenience. We want to improve this experience as soon as we can.

To provide a better diagnostic, we want to identify exactly what are the build targets that are taking so long in your environment. In order to do that, we need more information than the existing in the logs you've already provided.

Can you please (in Visual Studio) go to the Tools - Options menu, and in the "Project and Solutions" section (from the left tree) select "Build and Run". In the options, you have "MSBuild project build log file verbosity:" and "MSBuild project build output verbosity". Please set both to "Diagnostic".
Once you have done that, please "Rebuild All". You'll get a very verbose build information, but that should help us to better diagnostic the issue.

Can you please attach that verbose log file to this bug?

Thanks
Comment 10 Frank Buckley 2014-09-15 13:16:14 UTC
To confirm: simulator builds are quicker than device, but still slower than avoid build server compilation step (when not needed). The slowdown is multiplied by number of iOS projects in solution being built.

Often, you just want to check everything compiles OK in VS without the cost incurred completing build on build server.

Any news on enabling disconnection from build server?
Comment 11 Jose Gallardo 2014-09-15 15:14:18 UTC
Hi Frank,

The disconnected build improvements will be included in the next v3.6.x preview. (It's NOT included in v.3.6.197, which is currently available in Alpha).

Thanks
Comment 12 Frank Buckley 2014-09-17 04:56:00 UTC
Tested with Xamarin 3.6.239.0.

Disconnect now works great to speed up builds when full compilation on Mac not required.

Thanks.
Comment 13 Prashant manu 2014-09-30 08:24:49 UTC
We have checked with the attached solution with and without connecting to build server. When connected with build server attached build time for solution is about 1m 25 sec , however when in disconnect mode, build time for solution is around 25-30 secs.

As per this observation and based on comment 12 closing this issue.

@Frank , please reopen this issue if you face this issue again in future.

Thanks.

Environment Info:
Xamarin   3.7.166.0 (dbffe55069b63421bd693786930d7d5e43b571e8)
Win7, VS 2013
XI 8.2.0.190
Maverick 10.9.5
Comment 14 Jon Goldberger [MSFT] 2014-10-02 15:17:45 UTC
The customer noted in private comment 8 reports that using a wired connection as opposed to WiFi helped their build speed and made it 3x faster.
Comment 15 Adrian Alonso 2014-10-02 15:21:29 UTC
The PNGs fix should also help a lot when rebuild is no necessary because we're not longer copying the unchanged PNG files to the mac when the project/solution is Built (Rebuild of course will copy all files)
Comment 16 Jon Goldberger [MSFT] 2014-10-30 14:07:26 UTC
I have another customer describing slow build times, but in this case it is described as occurring even with a very simple app project and solution, so I am reopening this issue.

Customer's description (compiled from a few emails): 

====================
I have to wait over 5 minutes to Build and deploy the project. Sometimes, after 10 minutes it is still not carried out.

Is this issue also reported by other users?

I thought it could be because the package has about 26 MB and has to be transferred.

However I think is too slow. And the package is so big because of libraries: monotouch.dll is 8.535 kB, monotouch.dll.mdb is 2.635 kB, mscorlib.dll 2.598 kB, system.dll 1.290 kB…
-----------------------------
The problem appears with a new single template project. 

Regarding to the network connection, we have two separate computers. Windows with LAN connection and iMac with WiFi. I have asked IT support but they think the connection is fast enough to deal with such file sizes.
====================

[At this point the customer updated to Xamarin for VS 3.7.226 and XI (Mac) 8.2.0.207, which seemed to help the build times for about a week, then he continued:]

====================
The problem seems to happen again.

It takes a long time to build projects. I don’t know why. I just didn’t started Xamarin for almost a week and then, the problem is there again.
------------------------------
it is getting better, now. It is a quite strange issue.

Sometimes occurs, but it takes not as long as yesterday or this morning. At least we can work.---------------------------------------
I don’t see any difference between rebuilding and normal building. I have also tried to check / uncheck the option:

“Enable incremental builds”

in the iOS Build menu in project properties.

There is no difference. It takes always 1 minute. I must say too, that your idea about disconnecting is working. If I disconnect before each build (rebuild or normal build), it does it in a pair of seconds.

The storyboard is however always quite slow. It is difficult to work with it. I have to wait several seconds even when I perform small changes just as moving a simple control.

===========================
(End customer description)


## Notes: see the desk case for additional information. I had the customer delete the mtbserver.log file as that seemed to been causing some issues with build times or internal server errors. See: 
>http://forums.xamarin.com/discussion/25504/ios-designer-500-internal-server-error-avoid-by-using-xcode-5#latest

Also the customer did hit the error in the above forum link at one point during the investigation of slow build times.
Comment 19 Jon Goldberger [MSFT] 2014-11-03 15:40:53 UTC
I have another customer describing slow build times after the latest update:

"Since I updated to iOS 8 supported SDK my build time increased dramatically.
It takes like 10-15 seconds till my app actually starts building. It seems that
communication speed decreased between build host and PC (or amount of
data passed increased). Something is going on there."