bottleneck by java.lang.Class.getAnnotations()
Alan Bateman
Alan.Bateman at oracle.com
Thu Nov 1 07:11:11 PDT 2012
On 01/11/2012 13:17, Alexander Knöller wrote:
> Hi there.
>
> java.lang.Class.getAnnotations() always enters a synchronized-block, slowing down multi core machines that heavily make use of Annotations.
> (in our Case we use LoadTimeWeaving in the spring-framework 3.1.2)
> We are using sun-jdk 6 which has the same performance-bottleneck.
> openjdk7 and 8 show no fix so far, although it looks like it might be possible to build a kind of double-checked locking?
>
> Has this issue ever been persued?
>
> Special Regards
> Alex Knöller
>
If you have a proposal then I suggest bringing it to core-libs-dev for
discussion. In addition to contention there are other issues that need
attention there too, particularly the potential to deadlock and the
overhead per Class when annotations aren't used. There's definitely some
useful work that could be done there.
-Alan.
More information about the jdk6-dev
mailing list