backingstore: do not initialize memcache for debug builds

Summary:
Memcache is dogslow to initialize, taking >30s on debug build. As a
consequence, this slows down every single test by that amount time, with the
guarantee that no blobs will be found in memcache, ie: a total waste of time.

On release builds, Memcache is significantly faster to initialize, so let's
only disable initializing Memcache for debug builds only.

Reviewed By: fanzeyi

Differential Revision: D26800265

fbshipit-source-id: 8b393c603414de68268fdadb385de177e214a328
This commit is contained in:
Xavier Deguillard 2021-03-03 20:12:53 -08:00 committed by Facebook GitHub Bot
parent f22e274e94
commit d9207cbe4e

View File

@ -38,6 +38,9 @@ impl BackingStore {
.local_path(&store_path)
.suffix(Path::new("manifests"));
// Memcache takes 30s to initialize on debug builds slowing down tests significantly, let's
// not even try to initialize it then.
#[cfg(not(debug_assertions))]
match MemcacheStore::new(&config, NullProgressFactory::arc()) {
Ok(memcache) => {
// XXX: Add the memcachestore for the treestore.