[NEW BUG]: Reduce allocations in sun.reflect.annotation.AnnotationInvocationHandler.invoke()

Alan Bateman Alan.Bateman at oracle.com
Mon Nov 28 12:52:36 UTC 2016


On 28/11/2016 12:35, Christoph Dreis wrote:

> Hey,
>
> I'm new to the OpenJDK and not sure (yet) how the procedure especially for
> new bugs/enhancement is. So I apologise upfront if I made any mistakes.
>
> I'm working mostly with the Spring-Framework/Spring-Boot in my current
> projects. In these frameworks a lot of dynamic proxying can happen.
> Recently, I noticed that the JDK in versions 8 up to the current snapshots
> produces some allocations coming from
> sun.reflect.annotation.AnnotationInvocationHandler.invoke() we could avoid
> in the majority of cases. Only the check for equality needs the actual
> parameter types - all other cases only need the parameter count which JDK 8
> luckily provides with Method.getParameterCount().
>
> What about changing the current behaviour to something like my attached
> proposal? I'd be happy if someone is willing to sponsor this change. Again -
> if I made any mistakes here, please let me know for the next time.
>
Can you bring this to core-libs-dev for discussion?

-Alan


More information about the jdk9-dev mailing list