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

Reduce allocations during checksum creation. #76524

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ToddGrun
Copy link
Contributor

@ToddGrun ToddGrun commented Dec 19, 2024

From the csharp editing scrolling speedometer, I see about 0.3% of total allocations in the VS process occurring in Checksum.Create. A large part of these allocations are stream/writer constructions. Instead, this PR attempts to use a small pool to reuse and reset these objects.

*** before image showing % of VS allocations due to Checksum.Create ***
image

*** after image showing % of VS allocations due to Checksum.Create ***
image

*** before image showing types allocated under Checksum.Create ***
image

*** after image showing types allocated under Checksum.Create ***
image

Initially creating this PR as a draft PR to get speedometer results to see if this actually improves things.

From the csharp editing scrolling speedometer, I see about 0.3% of total allocations in the VS process occurring in Checksum.Create. A large part of these allocations are stream/writer constructions. Instead, this PR attempts to use a small pool to reuse and reset these objects.
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 19, 2024
@ToddGrun
Copy link
Contributor Author

ToddGrun commented Dec 19, 2024

Test insertion PR: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/599592

Speedometer results look good, elevating out of draft status

@ToddGrun ToddGrun marked this pull request as ready for review December 20, 2024 14:45
@ToddGrun ToddGrun requested a review from a team as a code owner December 20, 2024 14:45
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 VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant