CacheLib — Engineering Performance
18 engineers all time · Jan 2025 – Nov 2026 · built 2026-11-30 · GitHub
Performance snapshot
Today's rolling 90-day reading for CacheLib, compared with the start of the series. Pick a window to move that comparison point.
Avg. perf / dev / mo
+1364.0%
0.01 → 0.19 ETV
Active engineers
+66.7%
9.0 → 15.0
Features
+12.4pp
17.1% → 29.5%
vs. Meta
0.05x
0.02x → 0.05x · −95% below
CacheLib vs. Meta
Per-engineer ETV for CacheLib against Meta as a whole. Both lines are 90-day rolling averages scaled to a 30-day month, so they share one axis and can be read against each other at any point. Pick a window to zoom the chart to it.
Performance Composition
Each month's output split by type of work: Features (new value), Maintenance (sustaining systems), Tests, Docs, and Fixes (rework). The yellow line is output per engineer, so when it rises each engineer is delivering more, whatever the team size did. Unit: Engineering Throughput Value (ETV).
Engineering capacity
Effective engineers behind CacheLib, against its pre-AI baseline. Each subject has its own: CacheLib's is 0.40 ETV / dev / mo, its first reading in Q1 2025. Per-engineer ETV divided by that gives a capacity multiple, and that multiple applied to the engineers active in the trailing 90 days turns it into engineer-equivalents. The line is the real headcount, so the gap between line and area is what the leverage is worth. Because each baseline is its own, every subject opens at 1.0x on its first day: multiples measure improvement and are not comparable between subjects.
Knowledge concentration
How dependent is this repo on a small number of engineers? Higher top-1 share = higher key-person risk.
Rob Lyerly owns 35.9 % of commits.
Behind the numbers
Written summary of the work completed each month.
No monthly reports available yet.
Top engineers
Most impactful commits
Top 10 by ETV in the all-time window.
- 1.5ETVPropagate poolId and expiryTime through the Navy insert chain Summary: During NVM eviction, poolId is needed for the user's item destructor callback (DestructorData requires it), and expiryTime is needed for eviction stats (tracking expired evictions) and the checkExpired callback during region reclaim (skipping reinsertion of expired items). Currently both are obtained by reading the full item value from disk and extracting them from the NvmItem. Here are the exact code locations where poolId is used during NVM eviction: - evictCB receives the full item value — NvmCache.h:882-884 ``` void NvmCache<C>::evictCB(HashedKey hk, navy::BufferView value, // <-- full item read from disk navy::DestructorEvent event) { ``` - The value is cast to extract NvmItem — NvmCache.h:889 ``` const auto& nvmItem = *reinterpret_cast<const NvmItem*>(value.data()); ``` - poolId is passed to the item destructor callback — NvmCache.h:1014-1015 ``` itemDestructor_(DestructorData{context, item, std::move(chained), nvmItem.poolId()}); // <-- poolId extracted from NvmItem ``` - Eviction stats, tracking expired items -- fbcode/cachelib/allocator/nvmcache/NvmCache.h:897-903 ``` const auto expiryTime = nvmItem.getExpiryTime(); if (expiryTime != 0) { if (expiryTime < timeNow) { stats().numNvmExpiredEvict.inc(); stats().nvmEvictionSecondsPastExpiry_.trackValue(timeNow - expiryTime); } else { stats().nvmEvictionSecondsToExpiry_.trackValue(expiryTime - timeNow); } } ``` - checkExpired callback defined in NvmCache constructor used during reclaim -- fbcode/cachelib/allocator/nvmcache/NvmCache.h:1046-1049 ``` checkExpired_([](navy::BufferView v) -> bool { const auto& nvmItem = *reinterpret_cast<const NvmItem*>(v.data()); return nvmItem.isExpired(); }), ``` The key thing: nvmItem.poolId() requires having the full value bytes read from disk. So poolId needs to be stored in ItemMetadata and available without a device read. Also NVM item has to be recreated to access the expiry time right now. So expiryTime also needs to be part of ItemMetadata. In follow-up diffs, poolId and expiryTime will be stored in the per-item ItemMetadata struct at the tail of each BlockCache region. During eviction, they will be read from the lightweight metadata footer instead of performing a full device read. This diff is the prerequisite plumbing: it threads both values from the DRAM allocator (NvmCache::put) through the entire Navy insert chain (Driver -> EnginePair -> BlockCache/BigHash) so they are available where metadata is written to disk. Reviewed By: rlyerly Differential Revision: D94323531 fbshipit-source-id: 4e2325fa38fbc33c66868b65f9c69d73b5d5f81ePranav Bhandari · 87dc6c86 · 2026-04-13
- 1.5ETVThread lastAccessTimeSecs through Navy lookup/read path Summary: Widen Engine::lookup() to return lastAccessTimeSecs via out-param and propagate through EnginePair, Driver, AbstractCache (including the LookupCallback typedef). BlockCache::lookup() now populates the access time from the on-disk EntryDesc. BigHash and NoopEngine set it to 0. NvmCache lambdas accept the new param in find()/peek() and pass it through to onGetComplete(), but no behavioral change is made yet — the value is accepted and ignored. Reviewed By: AlnisM Differential Revision: D94776405 fbshipit-source-id: eeb21c43265b881571ef3920201bd3ea4942b21dPranav Bhandari · 3db84714 · 2026-03-19
- 1.1ETVadd support for dram iterator in cachebench Summary: Adding support to periodically run either the regular or lock group DRAM iterator. Reviewed By: rlyerly Differential Revision: D111821171 fbshipit-source-id: ce51835e77b7b19da6aa3cddfa79e621378b8432Alnis Murtovi · b88e4ba4 · 2026-08-06
- 0.8ETVAdd CacheComponent wrapper for LruAllocator Summary: Add a CacheItem/CacheComponent implementation for LruAllocator. Most of the interface APIs just forward calls directly to the underlying CacheAllocator, but we do need to do some munging between the generic and allocator-specific handles. Reviewed By: AlnisM Differential Revision: D83660459 fbshipit-source-id: 8d65be7cf3022c6e7e89b10f1ad09c076f50a76eRob Lyerly · fb205edf · 2025-11-10
- 0.8ETVReplace PageSizeT enum with helper class & raw bytes Summary: We currently hard-code 2 huge page sizes (2MB, 1GB) and use an enum to allow users to select the huge page size. These are only for x86-64, it doesn't handle aarch64 which has a bunch of different page sizes depending on the configured system page size. Switch to using a raw size_t instead that allows users to set arbitrary page sizes. While this is a bit less robust from the type system, it means: - We don't have to add a bunch of enum values every time we support a new platform - Avoids "false advertisement" - for example if I'm on x86-64 it looks like I can use all the aarch64-only values since they're in the enum. This is even more complicated because what page sizes are available is not knowable at compile time - aarch64 allows different base page sizes (4KB, 16KB, 64KB) and each one has its own set of huge page sizes. We can never collapse the enum down to *just* the available sizes for our platform at compile time. - All the OS interfaces use raw byte sizes anyway - We also don't need to worry about keeping a consistent ordering of the enum (e.g., if we serialize it to disk) Also add a helper PageSize class that encapsulates all this into helpers. Reviewed By: alikhtarov Differential Revision: D113587771 fbshipit-source-id: 439760d83da505a6be2be0bfa37912224415a015Rob Lyerly · 6199311e · 2026-08-11
- 0.8ETVRemove redundant copy on allocation path Summary: In BlockCache's allocation path we do an extra memcopy when writing an entry: - allocator_.allocate() allocates space in the region buffer and returns a RelAddress - writeEntry() allocates its own temporary Buffer to write the value, key & descriptor - writeEntry() then calls into RegionManager, which ultimately calls into region to memcpy from the temporary buffer into the Region buffer There's not a good reason to do this intermediate copy. It looks like internally Region grabs a lock to do the write into region memory, but 1. Allocation should give each writer its own space (meaning writes shouldn't overlap) 2. Readers can't actually read the data yet because the item isn't in the index yet 3. We won't detach the Region buffer until after flushing, which blocks until no more active writers. We bumped the active writer count when allocating. Eliminate the intermediate copy by having the allocation path to return a MutableBufferView to the allocated space. Then BlockCache can directly write into Region's buffer and avoid the temporary. Reviewed By: byahn0996 Differential Revision: D93918937 fbshipit-source-id: a03ba129c14d5a1175659403926d7b6c52d1b7b9Rob Lyerly · 33260a48 · 2026-03-19
- 0.8ETVreturn AllocateDescriptor from allocate() in CacheComponent::allocate Summary: Update allocate() implementations and callers to use AllocateDescriptor. Reviewed By: rlyerly Differential Revision: D116654110 fbshipit-source-id: 7bdebd30d91fc736fef6056f2184ee78041d1cf2Pranav Bhandari · 76301921 · 2026-08-28
- 0.7ETVtest memory monitor with scripted pressure Summary: Add cachebench configuration for CacheLib memory monitoring, including deterministic resident/free-memory providers and repeatable phase scripts. Each `memoryMonitorScript` phase returns `valueGB` for `durationMs`. After the final phase, its value remains active unless `memoryMonitorScriptRepeat` is true, which loops the script. Delay cache workers until pools are initialized for scripted runs, report cumulative advising and current advised slabs, and support subsecond polling. Reviewed By: rlyerly Differential Revision: D113025921 fbshipit-source-id: 5ab5df6b4fedbaf381ba66346e70d3509973a75bAlnis Murtovi · 02f71fdd · 2026-08-27
- 0.7ETVStart migrating to xxhash3 instead of fnv64_BROKEN Summary: I think we probably got code-modded into fnv64_BROKEN at some point to maintain backward compatibility. I don't see any reason to keep using fnv (see [this comment](https://www.internalfb.com/diff/D97303201?dst_version_fbid=3614828262026900&transaction_fbid=1595048764913150)) especially since it seems to increase the likelihood of collisions. I found this when investigating coredumps in Shots due to failed flocks on the metadata file (multiple processes trying to lock the same file). I don't know if this will help or not, but it shouldn't hurt. Unfortunately we can't just codemod into xxhash3 because we'll potentially orphan segment names generated from fnv64_BROKEN. While those would get cleared on host restart, it's likely that we won't have enough memory to keep the orphaned segments AND create new segments on simple process restarts, likely causing failures to start up. To migrate, we'll need to create segments using only the new hash function but look for segments using both the old and new hash. After a while, we can stop looking for segment names generated via the old hash. Reviewed By: r-barnes Differential Revision: D97303201 fbshipit-source-id: a1534fef159b7485ddd53ac9ab0bbeff70a7fbd3Rob Lyerly · a7b5387b · 2026-04-27
- 0.7ETVsupport multiple nvm arenas in cachebench Summary: Adds a `navyNumArenas` cachebench option that partitions a single NVM device into several independent Navy engine pairs ("arenas"). Each arena has its own BigHash and BlockCache, and keys are routed to an arena by `keyHash() % numArenas`. This lets cachebench exercise Navy's multi-engine setup. Sizing and validation: - `navyNumArenas` defaults to 1, preserving today's single-engine behavior. - When more than one arena is configured, `navyBigHashSizePct` is split across arenas (the remainder is spread over the first arenas) and the space left after metadata and BigHash is divided evenly into per-arena BlockCaches. Supporting changes: - `NavySetup`: factor out `getDeviceFileSize` and `getMetadataSize` helpers and expose `getNavyCacheSizes`, which returns the effective device and metadata sizes after Navy alignment. cachebench uses it to size the arenas. - `CacheStats`: replace the flat `bc*LatencyMicros*` fields with a per-arena `std::vector<BlockCacheLatencyStats>`. Item and logical-byte counters are summed across arenas, and each arena's latencies render under a `BlockCache[i]` label while the single-arena labels stay unchanged. - Add `feature_stress/navy/arenas.json`, a config exercising 3 arenas with both BigHash and BlockCache enabled. Reviewed By: rlyerly Differential Revision: D113025895 fbshipit-source-id: 48ce32aa99e9c764bd82846d1d711ce1c40f34d8Alnis Murtovi · 7c04a82d · 2026-08-06