mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
c31b7d9ef9
Summary: This introduces caching of filenodes to Memcache as in the old filenodes implementation. The code is mostly was ported over from the existing filenodes implementation, and converted to async / await. However, one key difference is that the lookups happen once we hold the semaphore to talk to the underlying MySQL shard. The reason for this is: - Reads to Memcache are really fast. They're often under 1ms. If you're going to miss in Memcache and have to go to SQL, it won't make you much slower. - Reads to Memcache are kinda expensive CPU-wise. Data in Memcache is compressed, and we often see a lot of our CPU cycles spent talking to Memache when we're under load. - Memcache isn't an infinite resource. If we're reading the exact same key a hundred times, that's going to hit the same Memcache box. A bit of deduplication on our end is a nice thing to strive for. Besides, our own thread pool we use to talk to Memcache is limited in size. From a performance perspective, this doesn't make things any slower, but reduces CPU usage when we'd otherwise have a lot of duplicate fetching. Finally, note that this update also includes support for dirty-tracking in our local cache. We use this to know if we should fill the remote cache (if we 100% hit in local cache, we don't fill the remote cache). Reviewed By: StanislavGlebik Differential Revision: D19905390 fbshipit-source-id: 363f638bb24cf488c7cd3a8ecea43e93f8391d3f |
||
---|---|---|
.. | ||
caching_ext/src | ||
slog_ext/src | ||
sql_ext/src |