As a Xamarin developer working on Android apps, you may be well-aware of two issues that slow down your everyday development; build times and the correctness of the build. If you aren’t sure what the latter is, think back to the last time you had to manually remove your bin/obj folders within your project in order to fix a failure.

bin/obj folders, still a better love story than twilight.

 

The Xamarin.Android team has been working hard on improving these two issues. In Visual Studio 2017 version 15.9 and Visual Studio for Mac 7.7 (Preview), we made a number of changes to improve these issues. First and foremost, we want to ensure that you can rely on your builds, and not have to resort to the time-sink of deleting your bin/obj folders and rebuilding your project from scratch. Secondly, we want to ensure there’s minimal turnaround time between making a change in your project and deploying to your device or emulator.

What you can expect

Starting with Xamarin.Android 9.1 and above, you will start to see changes to improved incremental build performance, and overall build correctness just by upgrading. You might notice slightly longer initial build times, as this is mainly due to ensuring we addressed build correctness issues that prevent bin/obj issues. Below, you can find comparisons between the Visual Studio 2017 15.8 and 15.9 releases and the respective performance with three different Android projects. Note: The higher the percentage change, the better.

Projects Used

Hello Forms – A File | New | Xamarin.Forms project.

SmartHotel360 – A sample Xamarin.Forms application.

Xamarin.Forms Control Gallery – The control gallery found in Xamarin.Forms.

Improvements to Incremental Build Times

 

App 15.8 15.9 % Change
Hello Forms (no changes) 00:02.99 00:02.75 8.03%
Hello Forms (XAML change) 00:08.03 00:06.63 17.43%
SmartHotel360 (no changes) 00:03.74 00:03.54 5.35%
SmartHotel360 (XAML change) 00:10.62 00:08.34 21.47%
Xamarin.Forms (no changes) 00:16.48 00:11.20 32.04%
Xamarin.Forms (XAML change) 00:52.53 00:35.34 32.72%

 

Improvements to Deploy Times

 

App 15.8 15.9 % Change
Hello Forms (first) 00:15.22 00:12.90 15.24%
Hello Forms (no changes) 00:03.07 00:02.83 7.82%
Hello Forms (XAML change) 00:07.06 00:06.63 6.09%
SmartHotel360 (first) 00:17.39 00:15.65 10.01%
SmartHotel360 (no changes) 00:03.88 00:03.69 4.9%
SmartHotel360 (XAML change) 00:09.03 00:05.10 43.52%
Xamarin.Forms (first) 00:19.30 00:13.76 28.7%
Xamarin.Forms (no changes) 00:16.82 00:11.90 29.25%
Xamarin.Forms (XAML change) 00:21.21 00:15.07 28.95%

 

Initial Build Times

 

App 15.8 15.9 % Change
Hello Forms (build) 00:35.93 00:37.33 +3.9%
Hello Forms (package) 00:07.74 00:07.33 5.3%
Hello Forms (deploy) 00:15.22 00:12.90 15.24%
SmartHotel360 (build) 01:04.20 01:05.90 +2.65%
SmartHotel360 (package) 00:10.65 00:10.53 1.13%
SmartHotel360 (deploy) 00:17.39 00:15.65 10.01%
Xamarin.Forms (build) 02:51.11 02:59.56 +3.37%
Xamarin.Forms (package) 00:18.70 00:18.19 2.73%
Xamarin.Forms (deploy) 00:19.30 00:13.76 28.7%

 

 

Update Today!

Xamarin.Android 9.1 is available today via Visual Studio 2017 (Stable) and Visual Studio 2017 for Mac (Preview).
In addition to these improvements, Xamarin.Android 9.1 delivers the latest in quality improvements. For a complete list of changes, check out the release notes.

Upcoming Improvements

Interested in finding out more about future build performance and correctness improvements in Xamarin.Android? Check out our Build Performance Ideas and Build Performance Results wikis for more details.

Feedback

We encourage everyone to engage with us on GitHub by reporting new issues or making suggestions. You can also use the Report a Problem option found in your favorite IDE via Help > Report a Problem to drop us a line.

Credits

A huge shout out to the Xamarin.Android Team, notably Jonathan Peppers, Dean Ellis, and Jonathan Pryor for their work on improving overall build performance and build correctness.