Re: [hibernate-dev] Optimizing reflection optimization

2010-06-04 Thread Кирилл Кленский
"Could you please create a JIRA?" JIRA ticket created: HHH-5289 Remove unnecessary security checks in property accessors According to the tests I have done it looks like reflection calls are taking a lot more time compared to the direct ones - even with newest Sun JVMs and with security checks dis

Re: [hibernate-dev] Optimizing reflection optimization

2010-06-02 Thread Steve Ebersole
Ok, now that is reasonable :) And looking through the source (for Field at least) is does circumvent a lot of checks if accessible is set. So I can move the '!ReflectHelper.isPublic' check into the catch blocks to continue to error in cases where we *need* to call setAccessible; for other cases I

Re: [hibernate-dev] Optimizing reflection optimization

2010-06-02 Thread Кирилл Кленский
"We do in fact utilize setAccessible in the Hibernate code" Yes, but if I am not mistaken only if the method/field is not public. From code: !ReflectHelper.isPublic(theClass, method) ) method.setAccessible(true); We could increase performance easily if we call setAccessible even for public methods

Re: [hibernate-dev] Optimizing reflection optimization

2010-06-02 Thread Steve Ebersole
Perhaps. We do in fact utilize setAccessible in the Hibernate code and so when I did performance testing I did that as well as it most closely matched our actual usage. Most likely it applies the checks "up front" when setAccessible is called. I'll take a look at the test and the numbers when i

Re: [hibernate-dev] Optimizing reflection optimization

2010-06-02 Thread Кирилл Кленский
Hi, I have done some tests that are more pure in that they do not involve the application logic. Java version: jdk1.6.0_19 32-bit Results include both client and server mode tests. Numbers represent 100 000 000 invocations time in milliseconds. The result format is the following: server_mode_

Re: [hibernate-dev] Optimizing reflection optimization

2010-05-27 Thread Steve Ebersole
Perhaps it short circuits those copies and other overheads if no security manager is defined (ala as in my IDE). That would explain how I can see minimal improvement while Kirill sees a 4x improvement. Still rather confirm these numbers are accurate. Kirill? On Thu, 2010-05-27 at 10:12 -0400, B

Re: [hibernate-dev] Optimizing reflection optimization

2010-05-27 Thread Bill Burke
Carlo deWolfe found that one of the big perf problems with Java reflection is that it is constantly doing security checks with the security manager and every get/find request makes a copy of the method/field objects. He had a hack for this, but you'll have to consult him on what it is. The JB

Re: [hibernate-dev] Optimizing reflection optimization

2010-05-27 Thread Steve Ebersole
I ran this same exact comparison before and I seem to recall much different results. Unfortunately I no longer have that code. This was part of http://opensource.atlassian.com/projects/hibernate/browse/HHH-227 Can you make sure you "prime" or "warm up" the jvm before you start taking measurement

Re: [hibernate-dev] Optimizing reflection optimization

2010-05-27 Thread Кирилл Кленский
Hi, My measurements have indicated that there is a performance gain. I have measured the time spent in setPropertyValues and getPropertyValues. The optimized version was 4 times faster in these methods giving an estimated application performance increase of about 3%. Optimizing getPropertyValue an

Re: [hibernate-dev] Optimizing reflection optimization

2010-05-26 Thread Emmanuel Bernard
Hi, Have you noticed a perf difference in your application with and without the patch? I am wondering if modern VMs have catched up with what Javassist does. On 26 mai 2010, at 18:29, Кирилл Кленский wrote: > 1. I have noticed that > org.hibernate.bytecode.javassist.BulkAccessorFactory.findAcces