Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Per CAY-2692 we added support for annotated callbacks on entities. This is a great feature that was requested repeatedly.
But it looks like we overlooked the performance aspect of it (which was the reason we didn't include it in Cayenne before. See comments in CAY-1559 for instance). So we need to dig a bit deeper here, as it will affect all projects, even those that are themselves not using annotations. I see a couple of problems:
- (minor refactoring needed) Class.getDeclaredMethods is called first in EntityResolver.initCallbacks() and the in inner loop inside CallbackOnEntity, even though we already know the method).
- (major concern) Eagerly scanning the entire mapped class hierarchy was very slow in the past. One of Cayenne advantages is fast startup. This may have a major impact on this. So let's profile a sufficiently large model with "wide" classes with lots of properties and see how bad it is.