snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Optimise RESTEasy for closed world #262

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Profling a Quarkus application it's immediatley visible that the current RESTEasy extension isn't taking advantage of the closed world assumption:

Annotation scanning and type introspection:

Stack Trace TLABs   Total TLAB Size(bytes)  Pressure(%)
java.lang.reflect.Method.getParameterTypes()    28  137,118,288 6.174
   sun.reflect.annotation.AnnotationInvocationHandler.invoke(Object, Method, Object[])  28  137,118,288 6.174
      com.sun.proxy.$Proxy17.annotationType()   16  77,359,528  3.483
         org.jboss.resteasy.spi.util.FindAnnotation.findAnnotation(Annotation[], Class) 16  77,359,528  3.483
            org.jboss.resteasy.plugins.providers.sse.SseEventSinkInterceptor.filter(ContainerRequestContext)    16  77,359,528  3.483

And more..

Stack Trace TLABs   Total TLAB Size(bytes)  Pressure(%)
java.lang.Class.getInterfaces() 425 2,083,949,208   93.826
   org.jboss.resteasy.core.providerfactory.Utils.createHeaderDelegateFromInterfaces(Map, Class[])   219 1,071,276,576   48.233
   org.jboss.resteasy.core.providerfactory.Utils.createHeaderDelegate(Map, Class)   206 1,012,672,632   45.594

I suppose this implies we can improve it a lot still?

The above methods have been identified when looking for strong allocators; this implies memory consumption could be cut down by dodging these operations.


https://github.com/quarkusio/quarkus/issues/4345


$upstream:4345$