Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip array sort when the length of array not greater than 1 #30934

Conversation

remeio
Copy link
Contributor

@remeio remeio commented Jul 24, 2023

Performance optimization(org.springframework.beans.factory.support.DefaultListableBeanFactory#resolveMultipleBeans):

For the sorting condition of Collection is result instanceof List<?> list && list.size() > 1, when the size of collection isn't greater than 1, it will skip sorting.

Similarly, skip array sort when the length of array not greater than 1.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 24, 2023
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 3, 2023
@jhoeller jhoeller added this to the 6.0.12 milestone Aug 3, 2023
@sbrannen sbrannen self-assigned this Aug 4, 2023
@sbrannen sbrannen closed this in 07a1aea Aug 4, 2023
@sbrannen
Copy link
Member

sbrannen commented Aug 4, 2023

This has been merged into 6.0.x and main.

Thanks

@remeio remeio deleted the skip_sort_on_length_of_array_not_greater_than_one branch August 15, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants