spring-projects / spring-projects/spring-boot

Optimize startup time: cache configuration

Open
#7,576 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

theme: performance type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

The Pet Clinic depends on EhCache, but it doesn't even use it unless the "production" profile is enabled. And yet it costs a couple hundred ms apparently (see benchmarks at https://github.com/dsyer/spring-boot-startup-bench). This might be just a special case of too much condition processing on startup, but I did notice that all cache types are configured in CacheConfigurationImportSelector, even if they are switched off by condition processing, and maybe this is unnecessary.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CacheConfigurationImportSelector and the linked Spring Boot startup benchmarks. Compare Pet Clinic startup with the production profile disabled and enabled, then determine whether avoiding inactive cache configuration processing improves startup time. Done means the optimization is supported by benchmark results and its impact is clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.