-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Serialisers.findWriters primitive wrapper lookup performance #37656
Comments
Would simply doing: if (klass.isPrimitive() && primitivesToWrappers.containsKey(klass)) be any better? I assume it would |
I am also wondering if |
There are few factors in place here:
In short, in theory there are no reasons why it should be that slower, but still:
If the map is small enough, the map version should suffer from less branch-mispredictions (than the other version using the chain of if), but probably, in this case, due to the many indirections, is still slower. |
Thanks for the analysis! |
Describe the bug
#37646 da11e0f has by accident made quarkus to search for the writers in the hot path, making evident a possible performance improvement
Probably this is not supposed to be an hot path, but in case it will, it "could" be addressed at
quarkus/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/ServerSerialisers.java
Line 90 in 3c1d1a0
where's
quarkus/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java
Line 50 in 3c1d1a0
could be replaced by some different mechanism eg a chain of equality check guarded by Class::isPrimitive, which is an intrinsic.
The text was updated successfully, but these errors were encountered: