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

Optimize DefaultLifecycleProcessor::stopBeans #30361

Merged

Conversation

aooohan
Copy link
Contributor

@aooohan aooohan commented Apr 21, 2023

Optimize DefaultLifecycleProcessor by reducing sorting and refactor stopBeans method.

Do this change due to LifecycleGroup has been sorted and member in which has same phase, so resort LifecycleGroupMember list to be meaningless.

If any improvements can do, feel free to tell me.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 21, 2023
@aooohan aooohan changed the title Optimize DefaultLifecycleProcessor Optimize DefaultLifecycleProcessor to reduce sorting Apr 21, 2023
Copy link
Contributor

@simonbasle simonbasle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 This is similar to changes made to startBeans in #25506 and since the LifecycleGroupMember phases map is created right before iteration, there shouldn't be any change in phase within the group's members

@simonbasle simonbasle added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 24, 2023
@simonbasle simonbasle added this to the 6.1.0-M1 milestone Apr 24, 2023
@simonbasle simonbasle changed the title Optimize DefaultLifecycleProcessor to reduce sorting Optimize DefaultLifecycleProcessor::stopBeans Apr 24, 2023
@simonbasle
Copy link
Contributor

LGTM. I've added some polish to the javadoc since it was making references to Comparable nature.

@simonbasle simonbasle self-assigned this Apr 24, 2023
@simonbasle simonbasle merged commit b311088 into spring-projects:main Apr 24, 2023
@aooohan aooohan deleted the optimize_default_lifecycle_processor branch April 25, 2023 01:49
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.

3 participants