Skip to content

Minimize RuntimeFramework cache key - #55034

Merged
rainersigwald merged 3 commits into
dotnet:mainfrom
rainersigwald:cache-actually-hittable
Jun 29, 2026
Merged

rainersigwald merged 3 commits into
dotnet:mainfrom
rainersigwald:cache-actually-hittable

Conversation

@rainersigwald

Copy link
Copy Markdown
Member

Copilot analysis of an allocation regression when inserting .NET SDK 11
into Visual Studio and building OrchardCore pointed to a 43× increase
in Slot[TaskItem][] allocations in ResolveTargetingPackAssets.

The cache key introduced in #53944 added all metadata to the cache
identity. That includes the computed metadatum DefiningProjectFullPath
that's distinct for every project, which caused spurious cache
invalidation.

Just reverting it didn't look quite right as another possibly-relevant
metadatum was added in #39402. Added that and put comments in both
places to hopefully avoid future drift.

Copilot analysis of an allocation regression when inserting .NET SDK 11
into Visual Studio and building OrchardCore pointed to a 43× increase
in `Slot[TaskItem][]` allocations in `ResolveTargetingPackAssets`.

The cache key introduced in dotnet#53944 added _all_ metadata to the cache
identity. That includes the computed metadatum `DefiningProjectFullPath`
that's distinct for every project, which caused spurious cache
invalidation.

Just reverting it didn't look quite right as another possibly-relevant
metadatum was added in dotnet#39402. Added that and put comments in both
places to hopefully avoid future drift.
@rainersigwald
rainersigwald requested a review from AlesProkop June 26, 2026 16:07
@rainersigwald rainersigwald self-assigned this Jun 26, 2026
Copilot AI review requested due to automatic review settings June 26, 2026 16:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

And use it in various places. Use preexisting MetadataKeys entries
where I noticed them.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@AlesProkop AlesProkop left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@rainersigwald
rainersigwald merged commit 727da13 into dotnet:main Jun 29, 2026
25 checks passed
@rainersigwald
rainersigwald deleted the cache-actually-hittable branch June 29, 2026 17:52
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jun 30, 2026
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