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

Use Map.of instead of custom implementation #9032

Merged
merged 1 commit into from
Mar 31, 2023
Merged

Use Map.of instead of custom implementation #9032

merged 1 commit into from
Mar 31, 2023

Conversation

dstepanov
Copy link
Contributor

It looks like Java's Map.of is more performant than our ImmutableSortedStringsArrayMap, I think it's better to use the native implementation.

We still have to keep the previous implementation till everything is recompiled and all nulls in map values are eliminated.

There are some stats:
Before:
AnnotationValueBenchmark.benchMarkGetValue thrpt 5 4686109.127 ± 176737.942 ops/s
After:
AnnotationValueBenchmark.benchMarkGetValue thrpt 5 4999775.733 ± 276019.217 ops/s

Before:
FullHttpStackBenchmark.test MICRONAUT avgt 30 20530.775 ± 252.348 ns/op
After:
FullHttpStackBenchmark.test MICRONAUT avgt 30 19438.006 ± 94.318 ns/op

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

71.8% 71.8% Coverage
0.0% 0.0% Duplication

}
}

public static boolean isSupportedMapValue(Object value) {
Copy link
Member

Choose a reason for hiding this comment

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

i think this should just be a giant ||

@graemerocher graemerocher added the type: improvement A minor improvement to an existing feature label Mar 31, 2023
@graemerocher graemerocher added this to the 4.0.0-M2 milestone Mar 31, 2023
@graemerocher graemerocher merged commit d65a608 into 4.0.x Mar 31, 2023
@graemerocher graemerocher deleted the usemapsof branch March 31, 2023 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants