Ronan the (twelve-second?) compile time for an empty project does seem a bit high... Mine generally runs for under five seconds (when empty).
You might want to watch what is going on with CPU. The compilation of a single project should be entirely cpu-bound, especially on the second or third attempt, after the file system has cached your source code (and all the nuget dependencies are downloaded). You may want to keep an eye on task-manager and make sure that you are running at full speed on a single core (ie 25% if you have four cores, 12% for eight cores, etc). If you see CPU drop down too far then something is going wrong. Also make sure to check that CPU is only being used by the usual things that you would expect, eg devenv.exe, VBCSCompiler.exe and MSBuild.exe.
For those who claim to be compiling UWP projects so much faster than everyone else, it might be interesting to hear their benchmarks for the windows community toolkit. (https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/rel/5.0.0) The most interesting compile times would be for projects that are most heavy on xaml. Here are my times:
- 10 seconds for Microsoft.Toolkit.Uwp.UI.Controls
- 8 seconds Microsoft.Toolkit.Uwp.UI.Controls.Graph
- 8 seconds Microsoft.Toolkit.Uwp.UI.Controls.DataGrid
The basic Van Arsdel inventory app is another thing to benchmark. https://github.com/Microsoft/InventorySample Here is my result:
- 14 seconds for Inventory.App
The VanArsdel sample app would be another good one to benchmark. (Careful with this; you may have to be on a Windows insider build and it may mess up your VS like it did mine). The url is here: https://github.com/microsoft/vanarsdel Here is my result:
- 13 seconds for VanArsdel project
Remember that projects which are heavily xaml-oriented are also usually the slowest because they involve more processing work during the various compilation passes.
Using Diagnostic Output
While the total elapsed time to build a project is critical, it may also be helpful to understand where the time is coming from. You can get a summary of that if you go to Tools->Options->Build-and-Run and then turn up the project build output verbosity to Diagnostic. Then compile the project in question. At the end you will see a Task Performance Summary that looks like the following. Note that CompileXaml should take the most time. These five items seem to be pretty common.
Task Performance Summary:
100 ms ValidateAppxManifest 1 calls
400 ms ExpandPriContent 1 calls
400 ms Csc 2 calls
600 ms ResolveAssemblyReference 1 calls
7000 ms CompileXaml 2 calls
If you see anything else (eg GenerateAppxManifest) taking up a few seconds every time you compile then that is probably a corruption problem within your project. You should be able to troubleshoot by searching for the word "completely", as in "Building target _GenerateCurrentProjectAppxManifest completely". When you find that, it should tell you why it is doing the extra work.
Min Version Targeting
I noticed that changing the min version on the targeting tab will cut out three seconds out of my "CompileXaml" time.
See below that changing min version to 15063 helps cut down on compile time. I suspect this is related to bloat in the related dependencies.
15063 (creators update) [4 seconds]
16299 (fall creators) [7 seconds]
17134 (version 1803) [ 7.5 seconds]
Its not always an option to target the creators update, so this may not be general-purpose fix. But it is interesting to know about the impact of getting an updated Windows 10 SDK.