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

Switch to a List as the backing store for the FAR window from an ImmutableList. #73589

Merged
merged 2 commits into from
May 20, 2024

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented May 20, 2024

Followup to #73587.

Saves several percent on looking up into the immutable array. As well as all hte overhead involved just mutating hte immutable-list (which is an AVL tree under the covers):

image

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 20, 2024
@CyrusNajmabadi CyrusNajmabadi changed the title Switch FAR data from an immutable dictionary to an immutable array @CyrusNajmabadi Switch to a List as the backing store for the FAR window from an ImmutableList. May 20, 2024
@CyrusNajmabadi CyrusNajmabadi changed the title @CyrusNajmabadi Switch to a List as the backing store for the FAR window from an ImmutableList. Switch to a List as the backing store for the FAR window from an ImmutableList. May 20, 2024
? EntriesWhenGroupingByDefinition
: EntriesWhenNotGroupingByDefinition;
? EntriesWhenGroupingByDefinition.ToImmutableArray()
: EntriesWhenNotGroupingByDefinition.ToImmutableArray();
Copy link
Member Author

Choose a reason for hiding this comment

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

here we make a snapshot to actually put into TableEntriesSnapshot. But this should be ok the vast majority of hte time. We're only updating this snapshot at most 4 times a second. So the amount of copies made by this is very small (didn't show up in any measurements). And the wins we get by just working with List vs an ImmutableList (which internally is an AVL tree) is substantive.

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review May 20, 2024 19:47
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 20, 2024 19:47
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:

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