Blazor AOT build time on Azure DevOps nearing 2 hours

Open
#111,270 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
azure, csharp, wasm

Research direction

Start by reproducing the Blazor Web.Client build with RunAOTCompilation enabled on an Azure DevOps windows-latest agent, focusing on the wasm AOT compile step. Compare the reported timings with the 16-core managed agent and investigate existing AOT build-time tracking work; done means a confirmed bottleneck, improvement, or linked plan for reducing compile time.

Written by the indexing model from the issue text.

Description

area-Codegen-AOT-mono tenet-performance
Description

I have a Blazor Web project which I build/deploy through Azure DevOps (using Aspire/azd tools).

I've found that to get reasonable UI performance with certain third party UI chart controls where there is a lot of user interaction and JS interop, I need to use AOT compilation with this in my Web.Client project file:

<PropertyGroup>
	<RunAOTCompilation>true</RunAOTCompilation>
	<WasmStripILAfterAOT>false</WasmStripILAfterAOT>
</PropertyGroup>

The build/deploy time for my Blazor web app with AOT compilation enabled with a standard 'windows-latest' agent on Azure DevOps has crept up to nearly 2 hours which seems pretty crazy. It looks locally like its spending most of it's time in the wasm aot compile step.

I've used Azure Managed agent pools to get an on demand 16 core machine as an agent and that brings the build time down to about half an hour, which still seems like quite a long time.

Overall, this issue does make deploying the end to end microsoft web tech stack (.NET, Blazor, Azure DevOps, Azure) both slow but also very power hungry and therefore wasteful from an energy/CO2 perspective. As such, I hope it's something you can prioritize. I've no idea how many of your customers are trying to do the same, but it would be good to get the time/energy down.

Is there anything in the pipeline or ticket I can track for improvements to Blazor AOT compile time?

I'm going to experiment with the 'EmccLinkOptimizationFlag' elements I've found in another thread to see how that effects the balance of compile time vs. size and performance, but I'm hoping there's something more fundamental in the works.

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.