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

Update use of HashAlgorithm to reduce allocations #19309

Closed
sharwell opened this issue May 5, 2017 · 4 comments
Closed

Update use of HashAlgorithm to reduce allocations #19309

sharwell opened this issue May 5, 2017 · 4 comments
Labels
Area-Analyzers Bug Tenet-Performance Regression in measured performance of the product from goals.

Comments

@sharwell
Copy link
Member

sharwell commented May 5, 2017

Version Used: 15.1

PerfView is showing substantial overhead for the creation of a temporary array in HashAlgorithm.ComputeHash(Stream), originating from Microsoft.CodeAnalysis and Microsoft.CodeAnalysis.Workspaces. On my machine, this accounted for more than 3 seconds of time while Roslyn.sln was opening. Code using this method should be updated to use an alternative that allows the use of a caller-specified buffer from a pool.

@CyrusNajmabadi
Copy link
Member

tagging @heejaechang

From talking to heejae earlier, we're nto certain if anything can be helped here. The issue is that we're not computing the hash and throwing away the value. We hold onto the value. So pooling isn't helpful.

@sharwell
Copy link
Member Author

sharwell commented May 6, 2017

@CyrusNajmabadi The time spent is in clr!JIT_NewArr1. It's literally the buffer allocation using for reading from the stream that's taking time.

@CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi
Copy link
Member

Can you be more specific sam? I can imagine a lot of different buffers at play here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers Bug Tenet-Performance Regression in measured performance of the product from goals.
Projects
None yet
Development

No branches or pull requests

3 participants