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

An opportunity for optimization in ImmutableArrayExtensions.CreateNameToMembersMap #67990

Closed
AlekseyTs opened this issue Apr 26, 2023 · 1 comment · Fixed by #67997
Closed
Assignees
Labels
Area-Compilers Concept-Design Debt Engineering Debt, Design Debt, or poor product code quality
Milestone

Comments

@AlekseyTs
Copy link
Contributor

members = hasNamespaces
? builder.ToImmutable()
: ImmutableArray<TNamespaceOrTypeSymbol>.CastUp(builder.ToDowncastedImmutable<TNamedTypeSymbol>());
builder.Free();

One branch could do builder.ToImmutableAndFree(), which would allow for the optimization of moving the internal array to the immutable array without a copy.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 26, 2023
@jcouv
Copy link
Member

jcouv commented Apr 28, 2023

Assigned to @CyrusNajmabadi since he already has a fix in review.

@jcouv jcouv added Concept-Design Debt Engineering Debt, Design Debt, or poor product code quality and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 28, 2023
@jcouv jcouv added this to the 17.7 milestone Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Concept-Design Debt Engineering Debt, Design Debt, or poor product code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants