Skip to content

Conversation

@Erarndt
Copy link
Contributor

@Erarndt Erarndt commented Jul 11, 2025

Fixes #

Context

The SolutionConfiguration class has several internal dictionaries that are allocated and populated in the constructor. No size information is given, so there are resizing allocations that happen that can be minimized.

Before:

image

After:

image

Changes Made

Testing

Notes

Copilot AI review requested due to automatic review settings July 11, 2025 21:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR pre-allocates internal dictionaries in SolutionConfiguration using the known number of project configurations to reduce resizing overhead.

  • Removed inline field initializers and moved dictionary construction into the constructor.
  • Used projectConfigurationElements.Count as the initial capacity when building dictionaries.
  • Added an else branch to ensure dictionaries are always initialized (even when there are no configurations).

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the zero/default size will work I'd sure like to have the deduplication.

@Erarndt Erarndt requested a review from rainersigwald August 19, 2025 16:44
@JanProvaznik JanProvaznik merged commit e04c0d1 into dotnet:main Aug 25, 2025
9 checks passed
@Erarndt Erarndt deleted the dev/erarndt/solutionConfigDicts branch September 22, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants