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

Remove usage of weak-value-source for smart-open-scope references #58212

Merged
merged 2 commits into from
Dec 10, 2021

Conversation

CyrusNajmabadi
Copy link
Member

A/B testing (2000 people in each group) revealed no interesting change from just turning this off. My theory here is that for projecs that reference dlls from standard runtime locations, there is very little removal of said dlls, and the compiler ends up rooting all these assemblies anyways through any metadata symbols we have.

Also, because we are using the open-scope-system, the platform effectively does hteir memory mapping once and keeps that memory around forever (in case other components need it, or roslyn needs it again). So that is also effectively a fixed cost that won't ever be given back.

Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

And There Was Much Rejoicing

@@ -32,7 +29,7 @@ public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
if (_singleton == null)
{
var temporaryStorage = workspaceServices.GetService<ITemporaryStorageService>();
Interlocked.CompareExchange(ref _singleton, new VisualStudioMetadataReferenceManager(workspaceServices.Workspace, _serviceProvider, temporaryStorage), null);
Interlocked.CompareExchange(ref _singleton, new VisualStudioMetadataReferenceManager(_serviceProvider, temporaryStorage), null);
Copy link
Member

Choose a reason for hiding this comment

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

❗ This incorrectly provides a VisualStudioMetadataReferenceManager using the ITemporaryStorageService from an unrelated workspace. The cache field needs to be removed.

Copy link
Member

Choose a reason for hiding this comment

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

This bug isn't introduced by this pull request, but if you aren't fixing it here please file a bug for the 17.1 release.

@CyrusNajmabadi CyrusNajmabadi merged commit bea10ea into dotnet:main Dec 10, 2021
@ghost ghost added this to the Next milestone Dec 10, 2021
@Cosifne Cosifne modified the milestones: Next, 17.1.P3 Jan 5, 2022
@CyrusNajmabadi CyrusNajmabadi deleted the removeWeakValueSOurces branch February 1, 2022 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants