[MNG-6773] Slow extension key creation in DefaultExtensionRealmCache under lock
- Dominant language
- Java
- Stars
- 5.3k
- Forks
- 3.1k
- Avg merge
- 20h 42m
- Merged PRs (30d)
- 297
Description
**[Alexander Ashitkin](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=alexander%20ashitkin)** opened **[MNG-6773](https://issues.apache.org/jira/browse/MNG-6773?redirect=false)** and commented
synchronized method DefaultProjectBuildingHelper#createProjectRealm invokes io under lock:
```java
public CacheKey( List extensionArtifacts )
return new CacheKey( extensionArtifacts );
public Key createKey( List extensionArtifacts )
final ExtensionRealmCache.Key extensionKey = extensionRealmCache.createKey( artifacts );
final ExtensionRealmCache.Key extensionKey = extensionRealmCache.createKey( artifacts );
extensionRecord = extensionRealmCache.get( extensionKey );
```
That prevents graph build scaling in multithreaded implementation and slows down build in general. Having this operation improved allows to build graph faster up to 3..6 times for interim results processing
---
**Affects:** 3.6.2
**Issue Links:**
- [MNG-6774](https://issues.apache.org/jira/browse/MNG-6774) Speedup project graph build by paralleling operations
**Remote Links:**
- [GitHub Pull Request #288
](https://github.com/apache/maven/pull/288)
Contributor guide
Assessment
This issue has not been assessed yet.