{"id":38303,"date":"2018-11-21T11:45:55","date_gmt":"2018-11-21T16:45:55","guid":{"rendered":"https:\/\/blog.xamarin.com\/?p=38303"},"modified":"2019-08-16T07:04:13","modified_gmt":"2019-08-16T14:04:13","slug":"android-build-performance-reliability","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/xamarin\/android-build-performance-reliability\/","title":{"rendered":"Android Build Performance and Reliability"},"content":{"rendered":"<p>As a Xamarin developer working on Android apps, you may be well-aware of two issues that slow down your everyday development; <a href=\"https:\/\/xkcd.com\/303\/\">build times<\/a> and the correctness of the build. If you aren&#8217;t sure what the latter is, think back to the last time you had to manually remove your <em><strong>bin\/obj folders<\/strong><\/em> within your project in order to fix a failure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/BinObjFolders.png\"><img decoding=\"async\" class=\"aligncenter wp-image-38304 size-full\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/BinObjFolders.png\" alt=\"\" width=\"586\" height=\"285\" \/><\/a><\/p>\n<\/div>\n<div style=\"text-align: center\"><em>bin\/obj folders, still a better love story than twilight.<\/em><\/div>\n<p>&nbsp;<\/p>\n<div>\n<div>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 <em><strong>bin\/obj folders<\/strong><\/em> and rebuilding your project from scratch. Secondly, we want to ensure there&#8217;s minimal turnaround time between making a change in your project and deploying to your device or emulator.<\/div>\n<\/div>\n<h2>What you can expect<\/h2>\n<div>\n<div>Starting with <strong>Xamarin.Android 9.1 and above<\/strong>, 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 <em><strong>bin\/obj issues<\/strong><\/em>. 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.\u00a0<strong>Note:<\/strong> The higher the percentage change, the better.<\/div>\n<\/div>\n<h3>Projects Used<\/h3>\n<p><strong>Hello Forms<\/strong> &#8211; A File | New | Xamarin.Forms project.<\/p>\n<p><a href=\"https:\/\/github.com\/Microsoft\/SmartHotel360\"><strong>SmartHotel360<\/strong><\/a> &#8211; A sample Xamarin.Forms application.<\/p>\n<p><a href=\"https:\/\/github.com\/xamarin\/\"><strong>Xamarin.Forms Control Gallery<\/strong><\/a> &#8211; The control gallery found in Xamarin.Forms.<\/p>\n<h3 style=\"text-align: left\">Improvements to Incremental Build Times<\/h3>\n<p>&nbsp;<\/p>\n<table align=\"center\">\n<thead>\n<tr>\n<th style=\"text-align: center\">App<\/th>\n<th style=\"text-align: center\">15.8<\/th>\n<th style=\"text-align: center\">15.9<\/th>\n<th style=\"text-align: center\">% Change<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Hello Forms (no changes)<\/td>\n<td>00:02.99<\/td>\n<td>00:02.75<\/td>\n<td><strong>8.03%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Hello Forms (XAML change)<\/td>\n<td>00:08.03<\/td>\n<td>00:06.63<\/td>\n<td><strong>17.43%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>SmartHotel360 (no changes)<\/td>\n<td>00:03.74<\/td>\n<td>00:03.54<\/td>\n<td><strong>5.35%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>SmartHotel360 (XAML change)<\/td>\n<td>00:10.62<\/td>\n<td>00:08.34<\/td>\n<td><strong>21.47%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Xamarin.Forms (no changes)<\/td>\n<td>00:16.48<\/td>\n<td>00:11.20<\/td>\n<td><strong>32.04%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Xamarin.Forms (XAML change)<\/td>\n<td>00:52.53<\/td>\n<td>00:35.34<\/td>\n<td><strong>32.72%<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3 style=\"text-align: left\">Improvements to Deploy Times<\/h3>\n<p>&nbsp;<\/p>\n<table align=\"center\">\n<thead>\n<tr>\n<th>App<\/th>\n<th>15.8<\/th>\n<th>15.9<\/th>\n<th>% Change<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Hello Forms (first)<\/td>\n<td>00:15.22<\/td>\n<td>00:12.90<\/td>\n<td><strong>15.24%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Hello Forms (no changes)<\/td>\n<td>00:03.07<\/td>\n<td>00:02.83<\/td>\n<td><strong>7.82%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Hello Forms (XAML change)<\/td>\n<td>00:07.06<\/td>\n<td>00:06.63<\/td>\n<td><strong>6.09%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>SmartHotel360 (first)<\/td>\n<td>00:17.39<\/td>\n<td>00:15.65<\/td>\n<td><strong>10.01%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>SmartHotel360 (no changes)<\/td>\n<td>00:03.88<\/td>\n<td>00:03.69<\/td>\n<td><strong>4.9%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>SmartHotel360 (XAML change)<\/td>\n<td>00:09.03<\/td>\n<td>00:05.10<\/td>\n<td><strong>43.52%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Xamarin.Forms (first)<\/td>\n<td>00:19.30<\/td>\n<td>00:13.76<\/td>\n<td><strong>28.7%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Xamarin.Forms (no changes)<\/td>\n<td>00:16.82<\/td>\n<td>00:11.90<\/td>\n<td><strong>29.25%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Xamarin.Forms (XAML change)<\/td>\n<td>00:21.21<\/td>\n<td>00:15.07<\/td>\n<td><strong>28.95%<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3 style=\"text-align: left\">Initial Build Times<\/h3>\n<p>&nbsp;<\/p>\n<table align=\"center\">\n<thead>\n<tr>\n<th>App<\/th>\n<th>15.8<\/th>\n<th>15.9<\/th>\n<th>% Change<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Hello Forms (build)<\/td>\n<td>00:35.93<\/td>\n<td>00:37.33<\/td>\n<td><strong>+3.9%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Hello Forms (package)<\/td>\n<td>00:07.74<\/td>\n<td>00:07.33<\/td>\n<td><strong>5.3%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Hello Forms (deploy)<\/td>\n<td>00:15.22<\/td>\n<td>00:12.90<\/td>\n<td><strong>15.24%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>SmartHotel360 (build)<\/td>\n<td>01:04.20<\/td>\n<td>01:05.90<\/td>\n<td><strong>+2.65%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>SmartHotel360 (package)<\/td>\n<td>00:10.65<\/td>\n<td>00:10.53<\/td>\n<td><strong>1.13%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>SmartHotel360 (deploy)<\/td>\n<td>00:17.39<\/td>\n<td>00:15.65<\/td>\n<td><strong>10.01%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Xamarin.Forms (build)<\/td>\n<td>02:51.11<\/td>\n<td>02:59.56<\/td>\n<td><strong>+3.37%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Xamarin.Forms (package)<\/td>\n<td>00:18.70<\/td>\n<td>00:18.19<\/td>\n<td><strong>2.73%<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Xamarin.Forms (deploy)<\/td>\n<td>00:19.30<\/td>\n<td>00:13.76<\/td>\n<td><strong>28.7%<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>Update Today!<\/h2>\n<div>\n<div>Xamarin.Android 9.1 is available today via <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/\">Visual Studio 2017<\/a>\u00a0(Stable) and <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/\">Visual Studio 2017 for Mac<\/a>\u00a0(Preview).<\/div>\n<\/div>\n<div><\/div>\n<div>In addition to these improvements, Xamarin.Android 9.1 delivers the latest in quality improvements. For a complete list of changes, <a href=\"https:\/\/developer.xamarin.com\/releases\/android\/xamarin.android_9\/xamarin.android_9.1\/\">check out the release notes.<\/a><\/div>\n<h2>Upcoming Improvements<\/h2>\n<p>Interested in finding out more about future build performance and correctness improvements in Xamarin.Android? Check out our <a href=\"https:\/\/github.com\/xamarin\/xamarin-android\/wiki\/Build-Performance-Ideas\">Build Performance Ideas<\/a> and\u00a0<a href=\"https:\/\/github.com\/xamarin\/xamarin-android\/wiki\/Build-Performance-Results\">Build Performance Results<\/a>\u00a0wikis for more details.<\/p>\n<div>\n<h2>Feedback<\/h2>\n<p>We encourage everyone to engage with us on GitHub by <a href=\"https:\/\/github.com\/xamarin\/xamarin-android\/wiki\/Submitting-Bugs,-Feature-Requests,-and-Pull-Requests\">reporting new issues or making suggestions<\/a>. You can also use the\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio-2017\">Report a Problem<\/a> option found in your favorite IDE via <strong>Help &gt; Report a Problem <\/strong>to drop us a line.<\/p>\n<\/div>\n<h3>Credits<\/h3>\n<p>A huge shout out to the Xamarin.Android Team, notably\u00a0<a href=\"https:\/\/github.com\/jonathanpeppers\">Jonathan Peppers<\/a>, <a href=\"https:\/\/github.com\/dellis1972\">Dean Ellis<\/a>, and\u00a0<a href=\"https:\/\/github.com\/jonpryor\">Jonathan Pryor<\/a>\u00a0for their work on improving overall build performance and build correctness.\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;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.<\/p>\n","protected":false},"author":551,"featured_media":40928,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[313,2],"tags":[5,648,779],"class_list":["post-38303","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","category-developers","tag-android","tag-performance","tag-reliability"],"acf":[],"blog_post_summary":"<p>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&#8217;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.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/38303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/users\/551"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/comments?post=38303"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/38303\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media\/40928"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media?parent=38303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/categories?post=38303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/tags?post=38303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}