Content-Length: 303586 | pFad | https://github.com/dotnet/runtime/pull/82536

19 Avoid locking on every ValidationAttributeStore lookup. by eiriktsarpalis · Pull Request #82536 · dotnet/runtime · GitHub
Skip to content

Avoid locking on every ValidationAttributeStore lookup. #82536

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

Merged
merged 1 commit into from
Feb 23, 2023

Conversation

eiriktsarpalis
Copy link
Member

The ValidationAttributeStore implementation uses a regular dictionary as a global cache that needs to lock on every lookup operation. This PR replaces it with a ConcurrentDictionary.

@ghost
Copy link

ghost commented Feb 23, 2023

Tagging subscribers to this area: @ajcvickers, @bricelam, @roji
See info in area-owners.md if you want to be subscribed.

Issue Details

The ValidationAttributeStore implementation uses a regular dictionary as a global cache that needs to lock on every lookup operation. This PR replaces it with a ConcurrentDictionary.

Author: eiriktsarpalis
Assignees: eiriktsarpalis
Labels:

area-System.ComponentModel.DataAnnotations

Milestone: 8.0.0

@eiriktsarpalis eiriktsarpalis merged commit ff7c19f into dotnet:main Feb 23, 2023
@eiriktsarpalis eiriktsarpalis deleted the dataannotation-locking branch February 23, 2023 19:48
Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

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

Good catch on this. LGTM.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/dotnet/runtime/pull/82536

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy