-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Sync small-sized information across all projects in one batch call. #72975
Conversation
} | ||
|
||
await SynchronizeProjectAssetsAsync(allProjectStateChecksums, cancellationToken).ConfigureAwait(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass in all projects of interest here so we can sync individual bits of data for all of them at once.
AddAll(checksums, projectChecksums.Documents.Checksums); | ||
AddAll(checksums, projectChecksums.AdditionalDocuments.Checksums); | ||
AddAll(checksums, projectChecksums.AnalyzerConfigDocuments.Checksums); | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a lot of duplication that happens in the new code. the followup moves those into helpers that dedupe the pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the followup also makes us do this work in parallel
@@ -264,16 +264,25 @@ static SourceGeneratorExecutionVersionMap FilterToProjectCone(SourceGeneratorExe | |||
} | |||
|
|||
using var _2 = ArrayBuilder<ProjectInfo>.GetInstance(out var projectInfos); | |||
using var _3 = ArrayBuilder<ProjectStateChecksums>.GetInstance(out var projectStateChecksumsToAdd); | |||
|
|||
// added project | |||
foreach (var (projectId, newProjectChecksums) in newProjectIdToStateChecksums) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two loops now. the first to collect the projects to bulk sync. the second create the projectinfos with the newly sync'ed data to update the solution
@ToddGrun this is ready for review. |
@jasonmalinowski For review when you get back. |
in a solution like roslyn, we end up having 900 "projects" (where you get multiple roslyn-projects corresponding to each flavor a normal vs project). Querying for data for these individually adds up. Now, we can do things like ask for the attributes of all those projects in a single batch call.
What we still do at a per-project level is query it for its documents.
Note: there will be a followup to this PR that takes all these calls and allows them to run in parallel (dropping sync time in about 1/3rd).