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

Optimise primitive clazz checks #37655

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

franz1981
Copy link
Contributor

@franz1981 franz1981 commented Dec 11, 2023

I've run few microbenchmarks to be sure it is actually better performing than the original code, which has proved (in #37656) to be too costy.

I've used franz1981/java-puzzles@aa09c3d
with a fair distribution of class types, to save the JIT to optimize it somehow.

The results with # VM version: JDK 21, Java HotSpot(TM) 64-Bit Server VM, 21+35-LTS-2513 are

Benchmark                                             (noPrimitives)   Mode  Cnt           Score          Error  Units
CheckPrimitiveWrappers.lookupPrimitiveWrapper                   true  thrpt   30  1468019504.269 ± 14740624.010  ops/s
CheckPrimitiveWrappers.lookupPrimitiveWrapper                  false  thrpt   30   916703637.882 ±  7936655.776  ops/s
CheckPrimitiveWrappers.lookupPrimitiveWrapperWithMap            true  thrpt   30   729446870.700 ±  1902697.898  ops/s
CheckPrimitiveWrappers.lookupPrimitiveWrapperWithMap           false  thrpt   30   507266225.423 ±  4544529.352  ops/s

@franz1981 franz1981 changed the title Optimise primitive clazz checks Optimise primitive clazz checks (Fixes #37656) Dec 11, 2023
@franz1981 franz1981 force-pushed the faster_clazz_primitive_check branch from 7ddf961 to dd4ca8a Compare December 11, 2023 13:44
@franz1981 franz1981 force-pushed the faster_clazz_primitive_check branch from dd4ca8a to ffe454f Compare December 11, 2023 14:26
Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

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

Let's see what the perf test says

@franz1981
Copy link
Contributor Author

Given the existing baseline is just a very tiny improvement, like 4 M req/sec -> 4.1 M req/sec but consistent, meaning that is not noise.

@geoand
Copy link
Contributor

geoand commented Dec 11, 2023

Sounds good!

Copy link

quarkus-bot bot commented Dec 11, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@geoand geoand changed the title Optimise primitive clazz checks (Fixes #37656) Optimise primitive clazz checks Dec 12, 2023
@geoand geoand merged commit ea11786 into quarkusio:main Dec 12, 2023
42 checks passed
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Dec 12, 2023
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serialisers.findWriters primitive wrapper lookup performance
2 participants