Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-12 Thread David Holmes
Peter, Many thanks for preparing that patch. As we're leaving annotations behind lets continue any further discussion of this patch in a new email thread specific to JEP-149. I'll run this patch through some basic testing and performance benchmarks. The JEP will also need updating so I'll be

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-12 Thread Mandy Chung
Hi Peter, On 12/12/12 4:31 AM, Peter Levart wrote: Hi all, Ok, no problem. So here's a patch that summarizes what I did in the previous patch, but only for reflective fields (Field[], Method[], Constructor[]) not including annotations: http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/web

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-12 Thread Peter Levart
On 12/12/2012 04:34 PM, Peter Levart wrote: On 12/12/2012 11:59 AM, Joel Borggrén-Franck wrote: Hi all, First, thanks all of you that are involved in this! I agree with David here, lets split this up (for now) and do reflective objects in the context of jep-149 and annotations separately. A

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-12 Thread Peter Levart
On 12/12/2012 11:59 AM, Joel Borggrén-Franck wrote: Hi all, First, thanks all of you that are involved in this! I agree with David here, lets split this up (for now) and do reflective objects in the context of jep-149 and annotations separately. As you may know there are even more annotation

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-12 Thread Peter Levart
Hi all, Ok, no problem. So here's a patch that summarizes what I did in the previous patch, but only for reflective fields (Field[], Method[], Constructor[]) not including annotations: http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev/index.html The annotations part is unchanged sem

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-12 Thread Joel Borggrén-Franck
Hi all, First, thanks all of you that are involved in this! I agree with David here, lets split this up (for now) and do reflective objects in the context of jep-149 and annotations separately. As you may know there are even more annotation coming in with JSR 308 annotations on type (use), so

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-10 Thread Joe Darcy
Hi Peter, On 12/10/2012 02:23 PM, Peter Levart wrote: Hi David, Joe, I unpacked the src.zip of the first release of JDK 1.5.0. Here's the relevant part: private transient Map annotations; private transient Map declaredAnnotations; private synchronized void initAnnotationsIfNeces

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-10 Thread Peter Levart
Hi David, Joe, I unpacked the src.zip of the first release of JDK 1.5.0. Here's the relevant part: private transient Map annotations; private transient Map declaredAnnotations; private synchronized void initAnnotationsIfNecessary() { if (annotations != null) re

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-10 Thread Joe Darcy
Yes; the OpenJDK sources only go back to circa 2007, which was part-way into the JDK 7 release. The exact changesets of how annotations were added back in JDK 5 are not available publicly. However, the final results of that process may be mostly visible in the src.zip from JDK 5. HTH, -Joe

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-10 Thread Peter Levart
Ok, I've got it. Downloaded j2sdk1.4_19 and unpacked src.zip ... There are SoftReferences for individual Field/Method/Constructor arrays: // Caches for certain reflective results private static boolean useCaches = true; private volatile transient SoftReference declaredFields; pri

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-10 Thread Peter Levart
Hi David, It would be informative to look at how java.lang.Class evolved during history. The oldest revision I can access is from 1st of Dec. 2007, which already contains Java 1.5 code (annotations) and is more or less unchanged until now. The most interesting changesets would be those that i

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-10 Thread Peter Levart
On 12/10/2012 07:18 AM, David Holmes wrote: Hi Peter, Sorry for the delay on this. Thank you for taking it into consideration. I can only imagine how busy you are with other things. Generally your VolatileData and my ReflectionHelper are doing a similar job. But I agree with your reasoni

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-09 Thread David Holmes
Hi Peter, Sorry for the delay on this. Generally your VolatileData and my ReflectionHelper are doing a similar job. But I agree with your reasoning that all of the cached SoftReferences are likely to be cleared at once, and so a SoftReference to a helper object with direct references, is more

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-02 Thread Peter Levart
Hi David, Alan, Alexander and others, In the meanwhile I have added another annotations space optimization to the patch. If a Class doesn't inherit any annotations from a superclass, which I think is a common case, it assigns the same Map instance to "annotations" as well as "declaredAnnotatio

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-12-02 Thread David Holmes
On 1/12/2012 4:54 AM, Alan Bateman wrote: On 30/11/2012 18:36, Peter Levart wrote: : So, what do you think? What kind of tests should I prepare in addidion to those 3 so that the patch might get a consideration? I think this is good work and thanks for re-basing your patch. I know David plans

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-11-30 Thread Alan Bateman
On 30/11/2012 18:36, Peter Levart wrote: : So, what do you think? What kind of tests should I prepare in addidion to those 3 so that the patch might get a consideration? I think this is good work and thanks for re-basing your patch. I know David plans to do a detail review. I think it will req

Re: bottleneck by java.lang.Class.getAnnotations() - rebased patch

2012-11-30 Thread Peter Levart
Hi Alan, David, Alexander and others, I noticed the push of Joe Darcy's code for repeating annotations which makes my proposed patch not entirely compatible with new code. So I rebased the patch to current code in jdk8/tl/jdk repository. I had to revert my last improvement (the replacement of