Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
-
None
Description
Java reflection will do security checks for each invocation, but if setAccessible(true) called for the accessible objects, the unneccessary security checks could be avoided.
See the result of "Performance Test":
FastMethodPerfTest.constructor_reflect_StringCtorCharArray avgt 15 18.471 ± 0.510 ns/op FastMethodPerfTest.constructor_reflect_accessible_StringCtorCharArray avgt 15 17.003 ± 0.528 ns/op FastMethodPerfTest.method_reflect_StringStartsWith avgt 15 12.264 ± 0.682 ns/op FastMethodPerfTest.method_reflect_accessible_StringStartsWith avgt 15 9.640 ± 0.732 ns/op