Bug 42038 - Xamarin.Forms Solution takes a long time to open and Re-Build
Summary: Xamarin.Forms Solution takes a long time to open and Re-Build
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Xamarin.Forms ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-06-21 17:17 UTC by Reader Man
Modified: 2016-12-23 02:47 UTC (History)
6 users (show)

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

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 Reader Man 2016-06-21 17:17:26 UTC
# Steps to reproduce

When Opening a Xamarin.Forms solution, it takes much more time, than a normal WinForms Solution having the same number of projects as class library, also when compiling (I am not talking about running) only compiling, it will take a long time, compared to compiling a WinForms solution.

As you can see in the link for the App8.zip solution.

I have a solution that has 55 projects, and its taking a very long time to load, now neglecting if it’s a bad design or not, it does not have a lot of classes, only many projects, and takes several minutes, from 3:30~4+ minutes.
And to re-build(re-compile) the hole solution, from 1~2 minutes.

Now the deployment in debug mode for android(setting the .Droid project as startup) and pressing the debug button on [5” Marshmallow (6.0.0) XHDPI Phone (Android 6.0 – API 23)], will take 1+ minute, and I did not count the launch of the emulator, as the emulator is running before the debug session, and also the solution was run in debug mode, then stopped, then again run in debug mode, without any modification of the code, but its still the same long time.


# Expected Behavior:
I think it should be looked into it, so it will be faster, at least comparable in loading/compiling/deployment (PCL vs Normal Class Library).

**Actual Behavior**:

Its very slow in Loading the solution and its projects especially if they are two many, and slow in compiling and in deployment.

Shared Solution “App8.zip” + “testSyncfusion.zip”, in Google drive:
https://drive.google.com/open?id=0B2xC75mde6w0bEFzMWFULTJtdkE

Note: All nuggets have been downloaded, so the nugget restoring is not the problem.

# Environment:
HDD: Samsung SSD 850 Pro 256GB
CPU: i7-2600 3.4GHz
RAM: 16GB
OS: win 10
IDE: VS 2015 update 2 + VS 2015 update 2 cumulative update: vs14-kb3151378.exe
Add-Ons: There is NO, I repeat no plug-ins like resharper or refactor installed, only plain VS, and even if they are, the loading of a solution having 55 normal class library projects, is faster than a solution having 55 PCL projects.
Xamarin: installed 4.1.0.530
Solution using Xamarin.Forms nuget 2.3.0.49

# Needed installations:

Syncfusion Essential Studio 2016 Vol 1 Xamarin u1 --> community edition: https://www.syncfusion.com/products/whatsnew
sqlite-uwp-3130000.vsix: https://www.sqlite.org/2016/sqlite-uwp-3130000.vsix
Visual Studio Emulator for Android 2.2: https://www.visualstudio.com/en-us/features/msft-android-emulator-vs.aspx

this was also written here:
https://github.com/dotnet/roslyn/issues/12130

as i don't know if this should be reported to Xamarin or Microsoft.
Comment 1 Reader Man 2016-06-22 01:03:34 UTC
**The Working Startup projects are only**:
testSyncfusion.Droid
testSyncfusion.UWP
And i am experiencing the problems with the testSyncfusion.Droid project.
Comment 2 Rui Marinho 2016-07-04 12:08:54 UTC
Can you try Update 3? I moved this to the VS team.
Comment 3 Reader Man 2016-07-04 16:01:10 UTC
Opening the solution
Yes I tried it, it took almost 4 minutes to open the solution, and this is even after doing the first two from this url:

https://github.com/dotnet/roslyn/wiki/Performance-considerations-for-large-solutions

* Disabling Full Solution Diagnostics
* Disabling CodeLens
Also To prevent NuGet from restoring packages during build, I unchecked 'Allow NuGet to download missing packages during build.' from the options of VS.


I think what the MS Team did, is optimize the "Normal Class Library" project types, and that the Xamarin PCL project types, have something that makes them very slow in comparison, and they did not look at it.

maybe if there is a log that logs the operations + the timing of opening each project in the solution, it will help you a lot.


Rebuilding:
And it took 1 minutes and 5 seconds to Rebuilding the whole solution, and here is the rebuild output:

https://drive.google.com/file/d/0B2xC75mde6w0ejRsTF9CRHAwMm8/view?usp=sharing
Comment 4 Adrian Alonso 2016-08-19 19:13:21 UTC
Hi, we have been working on several perf improvements that will be available in the next Cycle alpha release that should help to decrease loading solution time. Could you please give a try and let us know if the experience is now better?
Comment 5 Jose Gallardo 2016-12-23 02:47:54 UTC
Hi,
As we've added several improvements to our build system and deploying/debugging mechanism since the bug was reported, I'm resolving it tentatively as Fixed.
That said, if you're still facing this issue with current bits, please feel free to reopen the bug.
Thanks