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

Improve equals and hashCode implementations using Objects #2095

Merged
merged 3 commits into from
Jul 29, 2024

Conversation

Isira-Seneviratne
Copy link
Contributor

No description provided.

@jhy jhy added this to the 1.18.2 milestone Jul 29, 2024
@jhy jhy merged commit 48d4be4 into jhy:master Jul 29, 2024
11 checks passed
@jhy
Copy link
Owner

jhy commented Jul 29, 2024

Thanks, merged.

One point - the varargs method Objects.hash(Object... values) can create a lot of short-lived GC pressure when called as it creates wrapping Arrays for each invocation. I think in this case it is OK because the code looks so much better, and these hashcodes aren't typically called in performance critical loops. But I have removed other instances of varargs e.g. in the TreeBuilder after finding perf impacts. So just something to keep in mind for other code areas.

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.

2 participants