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

Minor startup performance improvement by caching results of XSD compare #7662

Merged
merged 5 commits into from
Oct 11, 2024

Conversation

tnleeuw
Copy link
Contributor

@tnleeuw tnleeuw commented Oct 9, 2024

Comparing XSD by content is expensive. Do it less often.

The benefit is not huge so feel free to close without applying if you prefer.

* <br/>
* The cache is keyed by the {@link System#identityHashCode} of the other XSD against which the comparison was made and stores the previous content-comparison result.
* The corresponding cache of the other XSD is also updated, keyed by our own identityHashCode. The identityHashCode is chosen because it's fast, and because
* it is guaranteed to be different for instances which might otherwise calculate the same {@link #hashCode()}.
Copy link
Contributor

Choose a reason for hiding this comment

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

Misschien ook nog even toevoegen dat je dit ook aan de andere kant van de compare bijhoudt (blokje in de if instanceof)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gedaan.

Copy link

@nielsm5 nielsm5 merged commit 70fb199 into master Oct 11, 2024
23 checks passed
@nielsm5 nielsm5 deleted the techdebt/XsdComparePerformanceImprovement branch October 11, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants