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

lock and Dictionary #33

Open
rioka opened this issue Mar 26, 2019 · 3 comments
Open

lock and Dictionary #33

rioka opened this issue Mar 26, 2019 · 3 comments
Labels

Comments

@rioka
Copy link

rioka commented Mar 26, 2019

Not an issue, I was just looking at the code and wondering... is there any specific reason to prefer lock+standard Dictionary over ConcurrentDictionary for _typeHash and _delegateCache in BuildProxy?

@jbtule
Copy link
Member

jbtule commented Mar 26, 2019

It's been so long, I'm not sure. Might have been performance tuned, or maybe not. There are tradeoffs and benefits performance wise for to ConcurrentDictionary. But honestly, it could be that it could benefit from a ConcurrentDictionary without manual locks, the choice for the dictionary was 9 years ago in the initial commit, makes me think it was something that was just overlooked.

@jbtule
Copy link
Member

jbtule commented Mar 26, 2019

That line was written a month after .net 4.0 was released, I pretty sure it was just overlooked.

@rioka
Copy link
Author

rioka commented May 28, 2019

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants