Skip to content

Consider caching resolved singleton beans in Provider instances #35373

@jhoeller

Description

@jhoeller

Following up on #35330, we should consider more aggressive caching of resolved singleton beans in Provider instances. This is not entirely trivial since providers are meant to call back into the core container for a fresh lookup, picking up the current scoped instance or even a changed singleton definition - even if the most common usage is for lazy singleton lookup, so we could consider specific caching in such a lazy singleton scenario (similar to how we cache the target instance behind a @Lazy injection point with a proxy).

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions