-
Notifications
You must be signed in to change notification settings - Fork 228
Restore perf work. #8995
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
Restore perf work. #8995
Conversation
Based on dotnet#8212 - Do an initial parse only once - If a document has changed, re-write the tag helpers, recording which ones were used - Re-run the tag helper re-write step, but check if the tag helpers have changed, and skip if we can
|
Benchmarks show expected improvements, with very small regressions in scenarios that were already fast (becuase we're doing slightly more work to calculate e.g. the tag helpers used). Edit: Updated so that |
jjonescz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM.
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/SourceGeneratorProjectEngine.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/SourceGeneratorProjectEngine.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/SourceGeneratorProjectEngine.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/SourceGeneratorRazorCodeDocument.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/RazorSourceGenerator.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/SourceGeneratorProjectEngine.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/RazorSourceGenerator.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/SourceGeneratorProjectEngine.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/RazorSourceGenerator.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/SourceGeneratorProjectEngine.cs
Outdated
Show resolved
Hide resolved
- Sealed, unreachable etc. - Refactor tag helper static feature aquisition to make it clearer - Remove unused tag helper methods
6b4f678 to
2504c2d
Compare
333fred
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chris can you please manually test this compiler with some exemplar projects? ASP.NET, MudBlazor, etc?
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/RazorSourceGenerator.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/SourceGeneratorRazorCodeDocument.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/StaticCompilationTagHelperFeature.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators/RazorSourceGenerator.Helpers.cs
Show resolved
Hide resolved
…neratorRazorCodeDocument.cs Co-authored-by: Fred Silberberg <[email protected]>
@333fred Its been run against MudBlazor and AspNetCore here: https://dev.azure.com/dnceng/internal/_build/results?buildId=2229220&view=logs&j=426a675b-bf70-5b3e-81b7-b93f7cef5a5e&t=7023cd9d-f1a8-5290-89a7-d879caa30bad |
333fred
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explicit testing!
* upstream/main: (188 commits) Rename CSHTML file reference. (dotnet#8969) Remove Omnisharp logic from main branch (dotnet#9027) Update dependencies from https://github.com/dotnet/arcade build 20230726.1 Fixes CVE-2023-33127 and CVE-2023-33170 (dotnet#9032) Remove Async Keyword For Generate Async Method Code Action (dotnet#9030) Remove dispatcher from DocumentVersionCache (dotnet#9026) Restore perf work. (dotnet#8995) Implement priority trigger support Change implementations and references Rename ProjectSnapshotChangeTrigger and convert to interface Updates after merge Fix nullability Use pattern matching Convert to record struct Move CloseTextTagOnAutoInsertProvider to FindToken (dotnet#9025) Move GenerateMethodCodeActionProvider to FindToken (dotnet#8988) Add comment describing when ProjectRazorJson.Version should be incremented Some more violations, after the merge Remove TryResolveDocument method [Infra] 17.8 P1 snap PRs (dotnet#9021) ...
Based on #8212