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 search better in UniqueAttributeValueConstraint #924

Merged
merged 6 commits into from
May 4, 2021

Conversation

twsouthwick
Copy link
Member

If a document happened to have a large number of elements that have the
UniqueAttributeValueConstraint validation, it will end up recalculating
the values for the constraint way too often. This was because the
constraint was generating the cached lookup with a key using the
attribute text itself. This change updates the lookup to cache all
possible duplicates for the element in question so it only has to be
searched once.

Fixes #918

If a document happened to have a large number of elements that have the
UniqueAttributeValueConstraint validation, it will end up recalculating
the values for the constraint way too often. This was because the
constraint was generating the cached lookup with a key using the
attribute text itself. This change updates the lookup to cache all
possible duplicates for the element in question so it only has to be
searched once.
@twsouthwick twsouthwick reopened this Apr 27, 2021
@twsouthwick
Copy link
Member Author

/azp run

@twsouthwick twsouthwick reopened this Apr 29, 2021
@twsouthwick twsouthwick merged commit 6184b08 into dotnet:main May 4, 2021
@twsouthwick twsouthwick deleted the fix-unique-attribute branch May 4, 2021 16:24
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.

OpenXml validation works slow starting from version 2.11.3
1 participant