SegmentedDictionary Initial Implementation and Tests - #1488
Merged
brianrob merged 2 commits intoSep 22, 2021
Merged
Conversation
Member
|
Overall, looks good. A couple of requests:
|
brianrob
approved these changes
Sep 22, 2021
brianrob
left a comment
Member
There was a problem hiding this comment.
A couple of questions here, but I'll go ahead and merge this into the feature branch to unblock further progress.
| } | ||
| } | ||
|
|
||
| public int Capacity => this.capacity; |
Member
There was a problem hiding this comment.
Would like to understand the need for these two new public APIs. Are these concerned internally by SegmentedDictionary?
| m_addressToNodeIndex = new Dictionary<Address, NodeIndex>(expectedSize); | ||
| // If we have too many addresses we will reach the Dictionary's internal array's size limit and throw. | ||
| // Therefore use a new implementation of it that is similar in performance but that can handle the extra load. | ||
| if (expectedSize > 200_000) |
Member
There was a problem hiding this comment.
Can you share where this number comes from? I realize that we have to pick something if we want to only impact "large" dumps, but just want to understand the math behind this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a
MemoryGraphhas many addresses, the internalDictionaryinstance it uses to keep track of them might run out of space due to its internal array's limitations. Hence, this PR adds a newSegmentedDictionaryclass that will not run into this issue. The original implementation of the class is located in the dotnet/roslyn repo and can be found here.The new class should have a similar performance to the
Dictionaryclass it is replacing. However, we will continue to use the old class unless we detect that we might run into the memory issue.This PR adds also the Generic
Dictionarytests from the dotnet/runtime repo to guarantee that the new implementation is behaving as expected.