Review Request -- CR6565585: Performance improvements to Method.invoke(), Contrstuctor.newInstance() and Field.getFieldAccessor()

David Holmes David.Holmes at oracle.com
Thu Mar 17 23:43:53 UTC 2011


Hi Mike,

"needless critical section" is a bit of a vague way to describe what is 
fundamentally a change to the caching strategy :) From a synchronization 
perspective I concur that the new strategy is valid, but I can't comment 
on whether the right access check is actually being performed.

In AccessibleObject.java, a minor nit, but place this comment:

+                 // (Test cache[1] first since range check for [1]
+                 // subsumes range check for [0].)

before the array access rather than after it.

Cheers,
David

Mike Duigou said the following on 03/18/11 09:04:
> Sorry folks--the webrev url: http://cr.openjdk.java.net/~mduigou/6565585/0/webrev/
> 
> Mike
> 
> On Mar 17 2011, at 15:07 , Mike Duigou wrote:
> 
>> Method.invoke(), Contrstuctor.newInstance() and Field.getFieldAccessor() all have a needless critical section, causing large slowdowns. This patch a replaces the synchronizations by volatile references. Finally, the changes remove a doubled reference to another volatile variable.  This also simplifies the generated code by commoning up the corresponding load instruction used in the fast execution path. 
>>
>> Speedups from this change are uniformly 2x or better.
>>
>> The proposed improvement and patch was originated by John Rose.
>>
>> Thanks,
>>
>> Mike
> 



More information about the core-libs-dev mailing list