Duplicate check
What problem does this solve?
During Maven import, M2E creates an expensive MavenProject for each Maven module and stores it in MavenProjectCache so later operations, such as builds, classpath configuration, launches, and editor features, etc., can reuse the model across Maven contexts.
MavenProjectCache has a default capacity of 50 cache lines. In large Maven workspaces (one example is the Quarkus repository, which contains approximately 1432 Maven projects), many imported MavenProject models can be evicted before the initial workspace-wide MavenBuilder pass needs them. Those cache misses force M2E to reconstruct models it had already created. When this happens across many projects, the repeated work can significantly increase the initial build and startup time.
This is related to #2167, which describes a problem caused by the same cache eviction/reload path, but this issue focuses on the performance impact during the import-to-initial-build transition.
Proposed solution
Keep the normal cache, but temporarily retain each imported MavenProject until its first relevant Maven build finishes.
Import creates MavenProject
│
├── normal cache (max 50)
└── temporary retention
│
▼
MavenBuilder
│
cache lookup
/ \
HIT MISS
│ │
│ retention lookup
│ │
│ HIT
│ │
│ restore to cache
│ │
└──────┬───────┘
▼
use MavenProject
│
▼
first relevant build finishes
│
▼
release retention
Was an AI/GenAI agent used to prepare this issue?
No
Duplicate check
What problem does this solve?
During Maven import, M2E creates an expensive
MavenProjectfor each Maven module and stores it inMavenProjectCacheso later operations, such as builds, classpath configuration, launches, and editor features, etc., can reuse the model across Maven contexts.MavenProjectCachehas a default capacity of 50 cache lines. In large Maven workspaces (one example is the Quarkus repository, which contains approximately 1432 Maven projects), many importedMavenProjectmodels can be evicted before the initial workspace-wideMavenBuilderpass needs them. Those cache misses force M2E to reconstruct models it had already created. When this happens across many projects, the repeated work can significantly increase the initial build and startup time.This is related to #2167, which describes a problem caused by the same cache eviction/reload path, but this issue focuses on the performance impact during the import-to-initial-build transition.
Proposed solution
Keep the normal cache, but temporarily retain each imported MavenProject until its first relevant Maven build finishes.
Was an AI/GenAI agent used to prepare this issue?
No