[LL FIR] Add Caffeine library dependency

- Our current FIR caches are based on `ConcurrentMap` and thereby do not
  support size and lifetime limits out of the box. For example,
  first-layer caches with a limited size can speed up access of the most
  frequently used elements, while having a small memory footprint.
- Caffeine is a modern and well optimized caching library that allows us
  to create thread-safe and performant caches with various size or
  lifetime limits.
- The cache must support concurrency because session components such as
  symbol providers may be accessed concurrently once parallel resolve in
  the Analysis API has been implemented (see KT-55750). Caffeine caches
  support concurrency.
This commit is contained in:
Marco Pennekamp
2023-03-28 20:33:38 +02:00
committed by Space Team
parent a7360a54fe
commit b805c6e32b
3 changed files with 223 additions and 0 deletions
@@ -26,6 +26,9 @@ dependencies {
implementation(project(":analysis:analysis-api-providers"))
implementation(project(":analysis:analysis-internal-utils"))
// We cannot use the latest version `3.1.5` because it doesn't support Java 8.
implementation("com.github.ben-manes.caffeine:caffeine:2.9.3")
api(intellijCore())
testApi(projectTests(":compiler:test-infrastructure-utils"))