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

Source generator server cache should consider MetadataReferences #57503

Open
chsienki opened this issue Nov 1, 2021 · 1 comment
Open

Source generator server cache should consider MetadataReferences #57503

chsienki opened this issue Nov 1, 2021 · 1 comment
Assignees
Milestone

Comments

@chsienki
Copy link
Contributor

chsienki commented Nov 1, 2021

Today, the generator driver compares metadata references via instance. In the compiler server cache, we create a new compilation between invocations; because the references are on the compilation, we don't consider them to be equal, even when the underlying assembly is the same.

In #57177 we added the ability to provide comparers for situations like this. We should add a metadata reference comparer, so that when the underlying assembly is the same we consider it to be equal.

This is especially important for perf in generators like the Razor SG which does a lot of work on the metadata references.

@chsienki chsienki added this to the 17.1 milestone Nov 1, 2021
@chsienki chsienki self-assigned this Nov 1, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Nov 1, 2021
@jaredpar jaredpar added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 2, 2021
@jaredpar
Copy link
Member

jaredpar commented Nov 2, 2021

Can this be as simple as comparing the MVID between the references?

@chsienki chsienki modified the milestones: 17.1, Compiler.Next Jan 12, 2022
@jaredpar jaredpar modified the milestones: Compiler.Next, Backlog Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants