[
https://issues.apache.org/jira/browse/CAY-2705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nikita Timofeev closed CAY-2705.
--------------------------------
Resolution: Fixed
For the history:
* optimization doesn't affect much, but numbers here are after it
* width of the entity doesn't affects either as we scan only methods defined in
the subclass
> Performance of callback annotation processing
> ---------------------------------------------
>
> Key: CAY-2705
> URL: https://issues.apache.org/jira/browse/CAY-2705
> Project: Cayenne
> Issue Type: Task
> Reporter: Andrus Adamchik
> Assignee: Nikita Timofeev
> Priority: Major
> Fix For: 4.2.B1
>
>
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)