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

Use a CacheKey struct for the ObjectCreator cache #2317

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

Conversation

scottfavre
Copy link

This is a candidate fix for #2315

The implementation of Dictionary will use hash codes under the hood, but handle collisions correctly.

By using a hashcode for the dictionary key the existing code prevents the .NET class from doing the right thing.

Notes:
This may degrade performance because cache hits need to do the full Equals call to verify that it is not a hash collision.
This may degrade performance because of changes in inlining behavior.

The implementation of Dictionary will use hash codes under the hood, but handle collisions correctly. By using a hashcode for the dictionary key we're preventing the .NET class from doing the right thing.

This may degrade performance because cache hits need to do the full Equals call to verify that it is not a hash collision.

This may degrade performance because of changes in inlining behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant