-
Notifications
You must be signed in to change notification settings - Fork 212
Compiler: Clean up and reduce allocations in declaration intermediate nodes (second try!) #12135
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
Merged
DustinCampbell
merged 12 commits into
dotnet:main
from
DustinCampbell:decl-intermediate-nodes
Aug 27, 2025
Merged
Compiler: Clean up and reduce allocations in declaration intermediate nodes (second try!) #12135
DustinCampbell
merged 12 commits into
dotnet:main
from
DustinCampbell:decl-intermediate-nodes
Aug 27, 2025
Conversation
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
- Enable nullable - Make Children property lazy. - Remove unnecessary argument-null checks - Rename Content property to Name
- Enable nullable - Make Children property lazy. - Remove unnecessary argument-null checks - Rename ClassName property to Name - Update Modifiers property to return ImmutableArray<string> - Update Interfaces property to return ImmutableArray<IntermediateToken> - Update TypeParameters property to return ImmutableArray<TypeParameter>
- Move auto-properties to top of class - Make most properties read-only - Use pattern matching to avoid accessing SourceSpan?.Value multiple times
- Enable nullable - Rename ParameterName property to Name - Update Name property to return IntermediateToken. - Update Constraints property to return IntermediateToken. - Remove ParameterNameSource property - Remove ConstraintsSource property - Add constructors - Make properties read-only
- Enable nullable
- Enable nullable - Remove unnecessary argument-null checks - Rename FieldName property to Name - Rename FieldType property to Type - Update Modifiers property to return ImmutableArray<string> - Update SuppressWarnings property to return ImmutableArray<string> - Make all properties init-only - Make Name and Type properties required
- Enable nullable - Remove unnecessary argument-null checks - Rename PropertyName property to Name - Rename PropertyType property to Type - Rename PropertyExpression property to ExpressionBody - Update Modifiers property to return ImmutableArray<string> - Make all properties init-only - Make Name, Type and ExpressionBody properties required
- Enable nullable - Remove unnecessary argument-null checks - Rename MethodName property to Name - Update Modifiers property to return ImmutableArray<string> - Update Parameters property to return ImmutableArray<MethodParameter>
- Enable nullable - Rename ParameterName property to Name - Rename TypeName property to Type - Update Modifiers property to return ImmutableArray<string> - Add constructor - Make properties read-only
davidwengier
approved these changes
Aug 22, 2025
ToddGrun
reviewed
Aug 22, 2025
...er/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentGenericTypePass.cs
Outdated
Show resolved
Hide resolved
ToddGrun
reviewed
Aug 22, 2025
...ler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Extensions/ImplementsDirectivePass.cs
Outdated
Show resolved
Hide resolved
ToddGrun
approved these changes
Aug 22, 2025
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.
@chsienki, PTAL |
chsienki
approved these changes
Aug 26, 2025
This was referenced Aug 28, 2025
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.
This is a bit of a rethink of #12024
This pull request cleans up and reduces allocations in declaration-level intermediate nodes:
NamespaceDeclarationIntermediateNode
,ClassDeclarationIntermediateNode
,MethodDeclarationIntermediateNode
,FieldDeclarationIntermediateNode
,PropertyDeclarationIntermediateNode
, and related types. In particular, various collection properties are no longer types asIList<T>
and pre-assigned with aList<T>
instance. Instead, these properties now returnImmutableArray<T>
.CI Build: https://dev.azure.com/dnceng/internal/_build/results?buildId=2777478&view=results
Test Insertion: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/663973
Toolset Run: https://dev.azure.com/dnceng/internal/_build/results?buildId=2777479&view=results