Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build performance improvements for Blazor #22566

Closed
Tracked by #5456
mkArtakMSFT opened this issue Jun 5, 2020 · 8 comments
Closed
Tracked by #5456

Build performance improvements for Blazor #22566

mkArtakMSFT opened this issue Jun 5, 2020 · 8 comments
Labels
affected-most This issue impacts most of the customers area-blazor Includes: Blazor, Razor Components area-razor.compiler This issue is related to the Razor compiler (now external) Components Big Rock This issue tracks a big effort which can span multiple issues enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-hot-reload This issue is related to the Hot Reload feaature feature-razor-sdk severity-major This label is used by an internal tool Theme: inner-loop
Milestone

Comments

@mkArtakMSFT
Copy link
Member

mkArtakMSFT commented Jun 5, 2020

For .NET 5 we plan to handle only this piece of work, which will later be part of the bigger Hot reload story for Blazor and potentially for all ASP.NET Core.

@mkArtakMSFT mkArtakMSFT added enhancement This issue represents an ask for new feature or an enhancement to an existing one Components Big Rock This issue tracks a big effort which can span multiple issues area-blazor Includes: Blazor, Razor Components labels Jun 5, 2020
@mkArtakMSFT mkArtakMSFT added this to the Next sprint planning milestone Jun 5, 2020
@danroth27 danroth27 mentioned this issue Jun 5, 2020
4 tasks
@ghost
Copy link

ghost commented Jul 22, 2020

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@pranavkm
Copy link
Contributor

A couple of things jump out that would help in the inner loop:

  • Any changes to a .razor file results in the declaration assembly being compiled, and tag helpers being discovered. If the change to a razor file is markup only, we could avoid doing this extra work.

  • Any change to a razor file results in all declaration and generated files being regenerated.

    • Declaration files generally do not need to be regenerated if the input is unchanged. I say generally because you could do something funky such as change the LangVersion or RazorLangVersion that could also change the declaration file, but these are rare occasions.
    • Regenerating the generated file could also be made incremental based on the input file and the tag helper discovery i.e. if the structure of other components do not change, we do not need to regenerate a component.

The time spent in code generation scales linearly with the number of razor files. Changing this would benefit projects with a large number of .razor files.

  • In Blazor WebAssembly, every build results in recalculating hashes on a bunch of files including runtime assets which remain unchanged unless you update the SDK. Calculating these hashes accounts for ~8% of our the inner loop for a standalone project. These values can be cached between builds.

  • The next set of items would be improving the inner loop with project to project references. This is being tracked by Make dotnet-watch more efficient by only executing required tasks for known change types #23073

@pranavkm
Copy link
Contributor

We're done with the work for 5.0. At this point, there's a risk of introducing bugs when making changes in the SDK. Parking this in the backlog to get back to addressing the additional investigations in 6.0.

@pranavkm pranavkm modified the milestones: 5.0.0-rc1, Backlog Aug 17, 2020
@ghost
Copy link

ghost commented Aug 17, 2020

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@mrlife
Copy link
Contributor

mrlife commented Aug 17, 2020

We're done with the work for 5.0. At this point, there's a risk of introducing bugs when making changes in the SDK. Parking this in the backlog to get back to addressing the additional investigations in 6.0.

Does this mean the work is done but won't be released until November 2021?

@pranavkm
Copy link
Contributor

@mrlife we addressed (1) of the 3 items listed above and that's available as part of the rc1 SDK (#24445). Doing (2) is a bit risky this late in the release. I might still do (3), but the savings (~100ms) and there are other things I'd like to address for 5.0.

@pranavkm pranavkm removed their assignment Aug 17, 2020
@SteveSandersonMS SteveSandersonMS added affected-most This issue impacts most of the customers severity-major This label is used by an internal tool labels Oct 6, 2020 — with ASP.NET Core Issue Ranking
@ghost
Copy link

ghost commented Oct 9, 2020

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@javiercn javiercn added feature-hot-reload This issue is related to the Hot Reload feaature area-razor.compiler This issue is related to the Razor compiler (now external) feature-razor-sdk labels Apr 20, 2021
@ghost
Copy link

ghost commented Jul 20, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affected-most This issue impacts most of the customers area-blazor Includes: Blazor, Razor Components area-razor.compiler This issue is related to the Razor compiler (now external) Components Big Rock This issue tracks a big effort which can span multiple issues enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-hot-reload This issue is related to the Hot Reload feaature feature-razor-sdk severity-major This label is used by an internal tool Theme: inner-loop
Projects
None yet
Development

No branches or pull requests

5 participants