Skip to content

ManagementContextAutoConfiguration adds a property source that degrades binding performance #45968

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

Closed
wants to merge 1 commit into from

Conversation

tanruian
Copy link
Contributor

@tanruian tanruian commented Jun 15, 2025

Update ManagementContextAutoConfiguration. use an EnumerablePropertySource to provide better property binding performance

Upgrade spring-boot to 3.5.0, an issue where a property source binds to java objects slowly, for deep nested collection (consists of 4 depth), around 1 minutes. Number of scans of property with exponential growth.
Because the ManagementContextAutoConfiguration automatically adds an un enumerable property source to the environment,resulting in the inability to confirm whether the property source contains bindable property, requiring guessing and traversing property one by one based on the index 0-12

#45970

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 15, 2025
@tanruian tanruian changed the title Improve performance by add enumerable propertySource Improve properties bind performance by add enumerable propertySource Jun 15, 2025
@philwebb
Copy link
Member

We might also be able to implement OriginLookup with isImmutable() returning true.

Update `ManagementContextAutoConfiguration`. use an EnumerablePropertySource to provide better property binding performance

Signed-off-by: tanruian <tanruiantra@qq.com>
@tanruian tanruian reopened this Jun 17, 2025
@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 17, 2025
@philwebb philwebb changed the title Improve properties bind performance by add enumerable propertySource ManagementContextAutoConfiguration adds a property source that degrades binding performance Jun 17, 2025
@philwebb philwebb added this to the 3.5.1 milestone Jun 17, 2025
@philwebb philwebb self-assigned this Jun 17, 2025
philwebb pushed a commit that referenced this pull request Jun 17, 2025
Update `ManagementContextAutoConfiguration` to use an immutable
`EnumerablePropertySource` to provide better property binding
performance.

See gh-45968

Signed-off-by: tanruian <tanruiantra@qq.com>
philwebb added a commit that referenced this pull request Jun 17, 2025
@philwebb philwebb closed this in ccdd79f Jun 17, 2025
@philwebb
Copy link
Member

Thanks very much @tanruian. I've made some changes for #45994 that should make these performance improvements less necessary. I still think they're worth fixing and I consider this a bug, but given it's less critical now the binder functionality has been restored, I'm only going to apply it to 3.5.x.

Thanks again for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants