Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0-M1
-
Fix Version/s: 2.3-M2
-
Component/s: None
-
Labels:None
Description
The fastest way to "interface" to Groovy code seems to be to implement the getProperty method in Java code. Calling getters is a longer route in Groovy.
For example passing "out" directly in getProperty is faster than just having the getOut method in the Groovy class.
I have implemented a proof-of-concept implementation for TagLibraryApi and it improves the performance by several percents.
A Groovy script could be used to generate the Java code from the getXXXX(Object instance) methods. That could be copy&pasted to the instance api implementation.
The same type of approach could be used also for controllers (params/request is used a lot).
Please read the comments... There is a better way using the AST transformations.
Issue Links
- relates to
-
GRAILS-8871
@CompileStatic / @TypeChecked compatibility
-
getProperty implementation of the POC.
Traditional code generator (groovy script) could be used to generate this (ugly, but efficient):