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

Avoid generating Document instances in cases where we only need a documentId in the work coordinator. #53817

Merged
merged 6 commits into from Jun 8, 2021

Conversation

CyrusNajmabadi
Copy link
Member

Fixes #53816


await _processor.EnqueueWorkItemAsync(document).ConfigureAwait(false);
await _processor.EnqueueWorkItemAsync(document.Project, document.Id, document).ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

if we were in a scenario where we actually had the document, then we pass it along to avoid extra work later.

Copy link
Member Author

Choose a reason for hiding this comment

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

we could consdier not passing hte doc with the hope that project.GetDocument(id) is cheap if the red doc was already created.


await _processor.EnqueueWorkItemAsync(document).ConfigureAwait(false);
await _processor.EnqueueWorkItemAsync(solution.GetRequiredProject(documentId.ProjectId), documentId, document: null).ConfigureAwait(false);
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to have some comment here that we're trying to avoid grabbing the Document? I can imagine somebody else coming back to this and wondering why it wasn't written the original way.

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.

Doesn't look bad from my perspective, but I admit I don't understand how much of this code works.

@CyrusNajmabadi CyrusNajmabadi merged commit 2f8bb1c into dotnet:main Jun 8, 2021
@ghost ghost added this to the Next milestone Jun 8, 2021
@CyrusNajmabadi CyrusNajmabadi deleted the avoidDocRealization branch June 8, 2021 01:19
@RikkiGibson RikkiGibson modified the milestones: Next, 17.0.P2 Jun 29, 2021
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.

Update EnqueueWorkItemAsync to operate on DocumentId
4 participants