-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
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:
- annotated_element_utils_jmc.jpg (483.01 kB)
Issue Links:
- ApplicationListener-like annotation for consuming application events [SPR-11622] #16245 ApplicationListener-like annotation for consuming application events
- Use AnnotatedElementUtils instead of AnnotationUtils wherever feasible [SPR-13440] #18020 Use AnnotatedElementUtils instead of AnnotationUtils wherever feasible