Discussion: WINUI 3.0 and XAML *Compile* Performance
Discussion: WINUI 3.0 and XAML Compile Performance
There was another discussion about XAML performance (runtime performance of xaml rendering). I didn't want to hijack that completely ... so I am opening this separate discussion about xaml compiler performance.
Here is the starting point for the discussion. @jtorjo said :
uwp compilation times are insanely slow! (pretty much, 6 times slower that WPF - i'm using target version build 1809 - build 17783)
I definitely agree. Debug/run iterations (development "inner loop") is quite slow compared with wpf or winforms, or most other U/I technologies. This productivity hurdle seems to be primarily related to the compilation of uwp-xaml. The performance of compiling uwp-xaml took a big turn for the worse after the "fall creator's update". There are many reports of performance troubles in the VS community including my own: https://developercommunity.visualstudio.com/content/problem/376045/compilation-of-uwp-xaml-project-is-slower-when-tar.html
Not to be overly critical, but I really don't think Microsoft has started looking deeply at developer productivity of UWP on the .net side of things. Or at least they aren't directly tackling the compilation side of the problem. They have invested in other approaches for improved productivity like xaml edit-and-continue, and "xaml studio", etc. While these are helpful, they seem like workarounds and it seems like a lot more can be done.
After one of my community posts about performance, the developer tools team had made a statement, although I cannot find it anymore (maybe censored?) . The team had added the following statement to my developercommunity post. The statement tries to explain the regression after the fall creator's update: "This performance issue you that identified was introduced in an effort to address build consistency issues, especially in incremental compiler situations. With that in mind, we are looking at ways to make this better so the compile time impact is less."
Here are some of the community posts on the topic of UWP compile performance (there are many):
My understanding is that redundant iterations of the "CompileXaml" tasks are being executed by Visual Studio (ie. even more compilation passes than reasonable)
I think the most constructive thing we can do is to provide hard measurements (from the VS output window) to corroborate our anecdotal observations that the compilation of uwp-xaml projects is slow. There may not be enough feedback, nor metrics from C#/desktop developers yet. (I suspect there are not enough of us to begin with. I suspect that much of the developer base for UWP/WINUI is still C++).
Capturing hard measurements is critical. I'd recommend tuning your workstation and then compiling the "vanarsdel" sample project on github. There are two of them - a regular vanarsdel and a vanarsdel "inventory sample". You can compare to my results on stack overflow, and then post your own results as well: https://stackoverflow.com/questions/52919086/speeding-up-compilation-in-uwp
I also want to point out that I had asked the question about xaml compile performance in the first winui community call : https://github.com/microsoft/microsoft-ui-xaml/issues/1478 ...
See the end of the video at 46:30. Someone named "Daniel" (Jacobson I believe) said they were going to try to improve performance for the "next version" of uwp/winui (see 47:30).
Related Links
Source: microsoft/microsoft-ui-xaml