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

Cache the return values for GetIdForErrorCode #31966

Merged
merged 1 commit into from
Jan 1, 2019

Conversation

sharwell
Copy link
Member

Fixes #31964

@sharwell sharwell requested a review from a team as a code owner December 20, 2018 20:43
@Therzok
Copy link
Contributor

Therzok commented Dec 21, 2018

Wouldn't an ImmutableDictionary + Interlocked operations be a better option than Concurrent Dictionary?

I'm asking because this might regress from a lock contention perspective

@sharwell
Copy link
Member Author

I'm asking because this might regress from a lock contention perspective

Assuming it lives up to its name, concurrent dictionary has a lock-free fast path 😄

@Therzok
Copy link
Contributor

Therzok commented Dec 21, 2018

Still, would be good to have profiling numbers. YMMV, but there's even allocation regressions from using a ConcurrentDictionary that could be more than the allocated strings we're seeing here.

@sharwell
Copy link
Member Author

Still, would be good to have profiling numbers.

Unfortunately this came from a customer trace, so I don't have a clean way to reproduce it locally.

YMMV, but there's even allocation regressions from using a ConcurrentDictionary that could be more than the allocated strings we're seeing here.

The trace that led to this showed over 125MiB of string allocations here. The only way to encounter this situation is for reads to overwhelmingly outnumber writes.

@333fred
Copy link
Member

333fred commented Dec 21, 2018

@dotnet/roslyn-compiler for a second review here.

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks (iteration 1)

@jcouv jcouv self-assigned this Dec 21, 2018
@jcouv jcouv added this to the 16.0.P2 milestone Dec 21, 2018
@sharwell
Copy link
Member Author

@jaredpar for approval

@jcouv
Copy link
Member

jcouv commented Dec 31, 2018

@sharwell This is approved to merge.

@sharwell sharwell merged commit 41393df into dotnet:master Jan 1, 2019
@sharwell sharwell deleted the cache-concat branch January 1, 2019 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants