Skip to content

Revisit @Bean introspection between @Configuration classes and 'lite' beans [SPR-17206] #21739

Closed
@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-17206 and commented

There is a lot of evidence that ConfigurationClassPostProcessor is bad for startup time. There is also some evidence that part of the problem is lite bean configuration - we have to scan all methods of all bean definition classes looking for @Bean. To investigate this I made a version of ConfigurationClassPostProcessor that only uses classes from spring.components. It is much faster when there are no @Configuration classes.

The rationale for introducing lite beans was IIRC so that you wouldn't pay the cost of CGLib proxying. But that is so much faster now than it was when we invented @Configuration I don't believe it adds up any more - the cost of processing annotations is much higher. And we have to recursively search all nested classes of all bean definitions. Ugh.

If lite beans were optional, Spring Boot could switch them off, and we can flush out all the usages (which are probably mostly accidental at this point).


Affects: 5.0.8

Issue Links:

2 votes, 8 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: taskA general task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions