Skip to content

Improve performance by maintaining sort of application listeners [SPR-17308] #21841

Closed

Description

@spring-projects-issues

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 (

) 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:

Activity

  1. spring-projects-issues commented on Sep 27, 2018

    @spring-projects-issues
    CollaboratorAuthor

    Samuel Bratton commented

    Hi, as I was working on opening this jira, I missed that a jira had already been opened on essentially the same issue an hour or so earlier, #21840, I reference a proposed code change in the description above but it only addresses one of the two listener types mentioned in #21840.

  2. spring-projects-issues commented on Sep 29, 2018

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    The revision applied for #21840 should hopefully address this case as well, maintaining a pre-sorting list in the cached retriever (for the common singleton case). This will be available in the upcoming 5.1.1.BUILD-SNAPSHOT; let me know if this doesn't provide the effect that you expected.

  3. added
    type: enhancement
    in: core
    status: duplicate
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: corestatus: duplicatetype: enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions