Make action cache concurrency-friendly to avoid high contention. Use...
Make action cache concurrency-friendly to avoid high contention. Use ConcurrentHashMap so there's no need for locking. Keep entries to be written to disk in a concurrent queue, and look their values up in the canonical map when writing them. This avoids races around writing data to the maps, although I don't know how big a deal that is anyway. Doesn't seem to have much of a wall-time impact, most likely because contention just moves around. Hoping to tackle some of the ultimate causes soon. PiperOrigin-RevId: 389272785
Showing
- src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java 16 additions, 20 deletions...build/lib/actions/cache/CompactPersistentActionCache.java
- src/main/java/com/google/devtools/build/lib/util/PersistentMap.java 57 additions, 67 deletions...ava/com/google/devtools/build/lib/util/PersistentMap.java
- src/test/java/com/google/devtools/build/lib/util/BUILD 2 additions, 0 deletionssrc/test/java/com/google/devtools/build/lib/util/BUILD
- src/test/java/com/google/devtools/build/lib/util/PersistentMapTest.java 45 additions, 10 deletions...com/google/devtools/build/lib/util/PersistentMapTest.java
Please register or sign in to comment