Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-14654

Cache ASM metadata at the context level

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 5.0 M1
    • Fix Version/s: 5.0 M4
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      While working on SPR-11890 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?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juergen.hoeller Juergen Hoeller
                Reporter:
                snicoll St├ęphane Nicoll
                Last updater:
                Juergen Hoeller
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 38 weeks, 5 days ago