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

Move to a callback-style approach to deserializing objects (part2) #72944

Merged
merged 13 commits into from
Apr 9, 2024

Conversation

CyrusNajmabadi
Copy link
Member

This moves to removing even more intermediary allocs, as well as allowing our lambdas to be static through the use of an TArg value passed along.

@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 8, 2024

await this.SynchronizeAssetsAsync(assetPath, checksums, results, cancellationToken).ConfigureAwait(false);

var result = new (Checksum checksum, T asset)[checksums.Count];
Copy link
Member Author

Choose a reason for hiding this comment

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

no intermediary alloc!

@@ -218,14 +218,15 @@ static SourceGeneratorExecutionVersionMap FilterToProjectCone(SourceGeneratorExe
using var _5 = PooledHashSet<Checksum>.GetInstance(out var newChecksumsToSync);
newChecksumsToSync.AddRange(newProjectIdToChecksum.Values);

var newProjectStateChecksums = await _assetProvider.GetAssetsAsync<ProjectStateChecksums>(
assetPath: AssetPath.SolutionAndTopLevelProjectsOnly, newChecksumsToSync, cancellationToken).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.

instead of having to allocate into this array, just to copy those all out and put into a dictionary below, we can now just read things right into the dictionary itself :)

@@ -503,14 +504,15 @@ private async Task<Project> UpdateProjectInfoAsync(Project project, Checksum inf
using var _5 = PooledHashSet<Checksum>.GetInstance(out var newChecksumsToSync);
newChecksumsToSync.AddRange(newDocumentIdToChecksum.Values);

var documentStateChecksums = await _assetProvider.GetAssetsAsync<DocumentStateChecksums>(
Copy link
Member Author

Choose a reason for hiding this comment

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

same here.

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review April 8, 2024 23:55
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner April 8, 2024 23:55
@CyrusNajmabadi
Copy link
Member Author

@ToddGrun ptal :)

using System.Collections.Generic;
using System.Collections.Immutable;
using System.Runtime.InteropServices;
Copy link
Contributor

Choose a reason for hiding this comment

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

not needed

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 b67df4c into dotnet:main Apr 9, 2024
25 of 27 checks passed
@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-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