Samuel Bratton opened SPR-17308 and commented
There's a slight but measurable performance hit due to sorting application listeners in AbstractApplicationEventMulticaster.java, even with as few as 2 listeners. The cost is incurred on every call to getApplicationListeners()when listeners are sorted (
|
AnnotationAwareOrderComparator.sort(allListeners); |
) By maintaining a sorted list as entries are added/removed this cost is reduced. There is a proposed change which can be mad a pull request here:
https://github.com/sebratton/spring-framework/tree/sort-application-listeners
Affects: 4.3.19, 5.0.9
Issue Links:
Samuel Bratton opened SPR-17308 and commented
There's a slight but measurable performance hit due to sorting application listeners in AbstractApplicationEventMulticaster.java, even with as few as 2 listeners. The cost is incurred on every call to getApplicationListeners()when listeners are sorted (
spring-framework/spring-context/src/main/java/org/springframework/context/event/AbstractApplicationEventMulticaster.java
Line 390 in e366b20
Affects: 4.3.19, 5.0.9
Issue Links: