Review Request -- CR6565585: Performance improvements to Method.invoke(), Contrstuctor.newInstance() and Field.getFieldAccessor()
David.Holmes at oracle.com
Thu Mar 17 16:43:53 PDT 2011
"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 first since range check for 
+ // subsumes range check for .)
before the array access rather than after it.
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/
> 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.
More information about the core-libs-dev