Skip to content

Conversation

obourgain
Copy link
Contributor

I started testing Leyden and Spring AOT on a pretty large Spring Boot application (>1M loc). While the bootstrap was already quite efficient, I get pretty impressive results, going from 13s to about 9s.
At this point, some minor inefficiencies start to show up in profiles, so I propose low effort fixes that result in about 70-100ms improvement.

Signed-off-by: Olivier Bourgain <olivierbourgain02@gmail.com>
Signed-off-by: Olivier Bourgain <olivierbourgain02@gmail.com>
The bean factory prefix is '&', so we can use a char comparison instead of more heavyweight String.startsWith("&")

Signed-off-by: Olivier Bourgain <olivierbourgain02@gmail.com>
Map lookup, while cheap, is still more expensive than instanceof.

Signed-off-by: Olivier Bourgain <olivierbourgain02@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 4, 2025
@sbrannen sbrannen changed the title Micro optims Micro optimizations Apr 4, 2025
@sbrannen sbrannen self-assigned this Apr 4, 2025
@sbrannen sbrannen added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 4, 2025
@sbrannen sbrannen added this to the 6.2.6 milestone Apr 4, 2025
@jhoeller jhoeller added the in: core Issues in core modules (aop, beans, core, context, expression) label Apr 4, 2025
@sbrannen sbrannen changed the title Micro optimizations Micro performance optimizations Apr 4, 2025
sbrannen added a commit that referenced this pull request Apr 4, 2025
sbrannen added a commit that referenced this pull request Apr 4, 2025
@sbrannen sbrannen closed this in 0f2308e Apr 4, 2025
@sbrannen
Copy link
Member

sbrannen commented Apr 4, 2025

Hi @obourgain,

Congratulations on submitting your first PR for the Spring Framework! 👍

These optimizations have been merged in 0f2308e, polished in 381bc4c, and extended in dbd47ff.

Thanks

sbrannen added a commit that referenced this pull request Apr 22, 2025
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.

4 participants