-
Notifications
You must be signed in to change notification settings - Fork 147
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
Allocate WeakKeyDictionary`2 with smaller initial capacities #222
Conversation
@lifengl Can you verify this change has the impact you expect? |
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 change looks good. I finally got a chance to verify it with loading Roslyn. The number of live tasks can change a lot, so only take memory snapshots after the product cool down gives some reasonable data. The result shows the memory usage of those collection is reduced about half with this change.
Sorry for the delay. I got two dumps with/without this change when I use VS to open Roslyn solution. Both taken when the product is cool down, and forced GC. The number of collections are similar: Without this change, those collections use 12M memory, and with it, they use 6M. This change is about to reduce the usage in half. |
sorry, click the close and comment button by a mistake |
Great. I can merge this PR for master now, but do you want to take it for 15.7? If so, can you let me know when the ask mode approval is obtained? |
Thinking about the overhead to doing it through ship room, especially no update for the threading library in 15.7, I will leave it to 15.8. |
Bumps [dotnet-coverage](https://github.com/microsoft/codecoverage) from 17.8.6 to 17.9.1. - [Commits](https://github.com/microsoft/codecoverage/commits) --- updated-dependencies: - dependency-name: dotnet-coverage dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fixes #221