Skip to content

Cache ASM metadata at the context level [SPR-14654] #19219

Closed
@spring-projects-issues

Description

@spring-projects-issues

Stéphane Nicoll opened SPR-14654 and commented

While working on #16509 I noticed that caching several ClassPathScanningCandidateComponentProvider instances are instantiated when the application context is refreshed. With Spring Boot in particular, those instances are working on the same base package(s) with different filters.

In the end we scan the same Resources, load the same meta-data and figure out based on that if we have to include the component.

It would be much nicer if that information was cached for the duration of the refresh. Also, creating a valid ClassPathScanningCandidateComponentProvider requires you to pass the Environment and the ResourceLoader. Both of those are available from ApplicationContext. Perhaps the latter could take care of providing a shared instance or something?


Affects: 5.0 M1

Issue Links:

Referenced from: commits 7818c65

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