Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use direct equals call instead of Objects.equals wrapper #5840

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

turbanoff
Copy link
Contributor

We known that name and tags are non-null values. (E.g. hashCode doesn't have null checks). When we know that value is non-null - we can call equals directly - it will be a bit faster

We known that `name` and `tags` are non-null values. (E.g. hashCode doesn't have `null` checks). When we know that value is non-null - we can call `equals` directly - it will be a bit faster

Signed-off-by: Andrey Turbanov <turbanoff@gmail.com>
@shakuzen shakuzen changed the title Use direct String.equals call instead of Objects.equals wrapper Use direct equals call instead of Objects.equals wrapper Jan 30, 2025
@shakuzen shakuzen added enhancement A general enhancement performance Issues related to general performance module: micrometer-core An issue that is related to our core module labels Jan 30, 2025
shakuzen

This comment was marked as duplicate.

Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

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

Sounds reasonable to me. The build is failing due to a now unused import. Could you please fix that?

Signed-off-by: Andrey Turbanov <turbanoff@gmail.com>
@shakuzen shakuzen added this to the 1.15.0-M2 milestone Jan 31, 2025
@shakuzen shakuzen merged commit 73b5133 into micrometer-metrics:main Jan 31, 2025
8 checks passed
@shakuzen
Copy link
Member

Thanks for the pull request. This will be included in the upcoming 1.15.0-M2 release.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement A general enhancement module: micrometer-core An issue that is related to our core module performance Issues related to general performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants