hk2166 commented on issue #16558:
URL: https://github.com/apache/grails-core/issues/16558#issuecomment-6448151207

   I'd like to work on this. The cost comes from domain instances taking the 
uncached instance path in 
`DataBindingUtils.getUnbindablePropertyNames(Object)`: for a GORM entity, the 
`constraintsMap`, `getConstraintsMap()` and `constraints` lookups all throw or 
return the constraints closure, so it falls through to 
`evaluateConstrainedProperties(object.getClass())` on every bind, a 
class-derived result that is recomputed each time (7.2.x read the AST-generated 
whitelist once per class).
   
   Proposal: for GORM entities, use the class-level cache, keyed on the 
persistent class the proxy handler resolves to (as #16491 does) and skipped 
when reloading is enabled, and keep the instance path for objects whose 
constraints can differ per instance. Tests would cover `bindable: false` on 
domain instances, proxies and subclasses, and that the constraints closure runs 
once per class.
   
   @jamesfredley @jdaugherty, does that fit the intent of #15947 and #16491?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to