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

PR feedback on syncing. #72996

Merged
merged 24 commits into from
Apr 12, 2024
Merged

PR feedback on syncing. #72996

merged 24 commits into from
Apr 12, 2024

Conversation

CyrusNajmabadi
Copy link
Member

Followup to #72990.

@CyrusNajmabadi CyrusNajmabadi requested review from a team as code owners April 12, 2024 18:48
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 12, 2024
@@ -152,6 +149,18 @@ async Task<ImmutableArray<DocumentInfo>> CreateDocumentInfosAsync(DocumentChecks
// TODO: do we need version?
return new DocumentInfo(attributes, textLoader, documentServiceProvider: null);
}

public AssetHelper<T> GetAssetHelper<T>()
Copy link
Member Author

Choose a reason for hiding this comment

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

this pattern helped make the callsites work better with inference, by splitting the type args into the parts that have to be specified (the T) and the part that can be inferred (the TArgs).

@CyrusNajmabadi
Copy link
Member Author

@ToddGrun ptal.

@@ -152,6 +149,18 @@ async Task<ImmutableArray<DocumentInfo>> CreateDocumentInfosAsync(DocumentChecks
// TODO: do we need version?
Copy link
Contributor

Choose a reason for hiding this comment

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

// TODO: do we need version?

TODO still in flux?

Copy link
Member Author

Choose a reason for hiding this comment

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

want to talk to you in person about this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Might be a week or two before I'm back in the office due to that machine going down. I don't have any strong thoughts here, I just saw a todo and wondered if it was still valid.

assetPath, checksumSet,
static (checksum, asset, builder) => builder.Add(asset),
builder,
cancellationToken).ConfigureAwait(false);

return builder.ToImmutableAndClear();
return builder.MoveToImmutable();
Copy link
Member Author

Choose a reason for hiding this comment

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

@ToddGrun note the movetoimmutable here. the builder itself produces no internal garbage. it just holds onto the array and count. MoveToImmtuable is just an ownership transform of its array to the IA result. So the only thing left is the builder itself, which should be trivially collected.

Note: one pattern we could consider here is pooling these builders when we've successfully moved their internal arrays out.

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

@CyrusNajmabadi CyrusNajmabadi merged commit 8a0cc11 into dotnet:main Apr 12, 2024
28 of 30 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Apr 12, 2024
@CyrusNajmabadi CyrusNajmabadi deleted the syncCleanup branch April 12, 2024 22:13
@CyrusNajmabadi
Copy link
Member Author

@jasonmalinowski For review when you get back.

@dibarbet dibarbet modified the milestones: Next, 17.11 P1 Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers 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.

4 participants