[
https://issues.apache.org/jira/browse/GROOVY-10216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Sun closed GROOVY-10216.
-------------------------------
Fix Version/s: (was: 4.0.0-beta-2)
Resolution: Won't Fix
> Avoid unnecessary security checks for each invocation
> -----------------------------------------------------
>
> Key: GROOVY-10216
> URL: https://issues.apache.org/jira/browse/GROOVY-10216
> Project: Groovy
> Issue Type: Improvement
> Reporter: Daniel Sun
> Assignee: Daniel Sun
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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":
> {code:java}
> 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
> {code}
> https://github.com/danielsun1106/fast-reflection
--
This message was sent by Atlassian Jira
(v8.20.1#820001)