[http-client-csharp] Skip unnecessary simplifier passes#10846
Draft
live1206 wants to merge 7 commits into
Draft
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
commit: |
Contributor
|
No changes needing a change description found. |
Run simplification for documents containing global aliases so shared-source type names and generated sample code are reduced correctly while still skipping documents that do not need simplification. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Generate valid assignment statements without relying on Roslyn simplification, and keep shared-source test expectations aligned with the skip behavior so broad global-alias simplification is not reintroduced. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refresh generated test projects and unit test expectations after skipping Roslyn simplification for documents without simplifier annotations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Avoid emitting a trailing space after array type syntax when the initializer is multiline. Regenerated outputs now match without manual generated-file whitespace edits. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use plain default for known cancellation token optional parameters so generated code remains valid when documents are not passed through Roslyn simplification. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refresh remaining generator unit test baselines after removing trailing spaces from multiline array initializers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Avoid running Roslyn
Simplifier.ReduceAsyncfor generated documents that do not containSimplifier.Annotation.Previously, every generated document root was annotated with
Simplifier.Annotation, which forced a full-document simplifier pass across all generated files. This removes the blanket root annotation and keeps the simplifier pass only for documents that still have targeted simplifier annotations after member removal and library rewriters.Motivation
While profiling Azure.ResourceManager.Network generation through the Azure management generator, Roslyn post-processing dominated the run time. The hotspot was
Simplifier.ReduceAsyncin the shared MTGGeneratedCodeWorkspace.ProcessDocumentpath.Local profiling results for direct Network generator runs:
This is about a 4m09s improvement for the direct Network generator run.
Notes
Simplifier.Annotationstill go throughSimplifier.ReduceAsync.Validation