Optimize ordered event listener performance [SPR-14642] #19208
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Christoph Dreis opened SPR-14642 and commented
Hey,
while doing some loadtests in our project, I noticed that AnnotatedElementUtils.searchWithFindSemantics() or rather AnnotatedElementUtils.findMergedAnnotation() are consuming quite some CPU. It's even above HashMap.getNode(int, Object) in some tests, which I find quite precarious for such a utility class. It looks like this is especially true for using
@Order
somewhere in the application in combination with@EventListener
functionality.I was wondering if this could be improved in any way? Maybe by caching merged annotation lookups much like in AnnotationUtils. Or maybe by just caching the order in the ApplicationListener context.
!annotated_element_utils_jmc.jpg|thumbnail!
Cheers,
Christoph
Affects: 4.3.2
Attachments:
Issue Links:
Referenced from: commits 58fa63f, 3b91dec
The text was updated successfully, but these errors were encountered: