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

Reduce project forks on solution open #73839

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

ToddGrun
Copy link
Contributor

@ToddGrun ToddGrun commented Jun 4, 2024

This doesn't have a huge impact on solution open time, so I'm on the fence about whether this is worth the churn. I think the new code is better, but I'm flexible about whether to pursue this.

*** CPU from forks (before) ***
image

*** CPU from forks (after) ***
image

This doesn't have a huge impact on solution open time, so I'm on the fence about whether this is worth the churn. I *think* the new code is better, but I'm flexible about whether to pursue this.
@ToddGrun ToddGrun requested a review from a team as a code owner June 4, 2024 17:34
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 4, 2024
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi left a comment

Choose a reason for hiding this comment

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

i'm on the fence here. there's enough complexity that i worry about some subtle regression. but i don't mind taking this if you want it.

{
// Changing a document in a linked-doc-chain will end up producing N changed documents. We only want to
// process that chain once.
if (processedDocuments.Add(changedDocumentId))
using var _ = PooledDictionary<DocumentId, DocumentState>.GetInstance(out var documentIdsToUpdate);
Copy link
Member

Choose a reason for hiding this comment

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

can this happen? do we have any case where we'd see a doc-id twice for changed docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was being careful, but it seems like two docs could change that have the same related document, no?

if (documentIdsToUpdate.Count == 0)
return solution;

var toProcessRelatedDocumentIds = documentIdsToUpdate.SelectAsArray(kvp => (kvp.Key, kvp.Value));
Copy link
Member

Choose a reason for hiding this comment

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

i can't quite reason about everything here. do we really ever need a map? couldn't an array work for this?

also, toProcessRelatedDocumentIds seems like the wrong name, since it's more than just the id.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I mentioned in the other comment, it seems like it could need a map. I'll change the name.

@ToddGrun
Copy link
Contributor Author

ToddGrun commented Jun 4, 2024

I'm a little more inclined to move forward since you didn't see anything blatantly wrong. Feels nice to get rid of the last big forking issue on solution open.


In reply to: 2097221328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants