-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b138
-
generic
-
generic
-
Not verified
java.lang.reflect.Method.invoke has a critical section which it doesn't really need, and which slows it down.
While investigating 6565458 (a code generation problem) I noticed that the fix to 6446522 added synchronizations to the hot path of reflective invokes. This successfully removed the race condition reported for 6446522, but made the generated code very complex.
I saw a simple way to speed up Method.invoke significantly by removing the critical section. The 6565458 test case gets a 3X speedup, since that micro-benchmark is simple enough to inline everything. As we improve our inlining heuristics, more use cases will see benefits from removing the critical section.
The critical section is also potentially a bottleneck in large concurrent systems.
While investigating 6565458 (a code generation problem) I noticed that the fix to 6446522 added synchronizations to the hot path of reflective invokes. This successfully removed the race condition reported for 6446522, but made the generated code very complex.
I saw a simple way to speed up Method.invoke significantly by removing the critical section. The 6565458 test case gets a 3X speedup, since that micro-benchmark is simple enough to inline everything. As we improve our inlining heuristics, more use cases will see benefits from removing the critical section.
The critical section is also potentially a bottleneck in large concurrent systems.
- relates to
-
JDK-6567922 (reflect) Method.invoke() should make a more direct call to its target method
- Open
-
JDK-6565458 10x performance regression on x86 in micro test with Reflection.
- Open