Start off storage cache with a larger size

Former-commit-id: 5f6fb970a81cc73586ba595b35564e7865e7262d
This commit is contained in:
John Sully 2020-08-09 00:57:56 +00:00
parent 11a8ab1865
commit 1610f4211f
2 changed files with 5 additions and 2 deletions

View File

@ -32,7 +32,7 @@ public:
StorageCache *cache = new StorageCache(nullptr);
if (pfactory->FSlow())
{
cache->m_setkeys = std::make_unique<semiorderedset<sdsimmutablestring, sdsview, true>>();
cache->m_setkeys = std::make_unique<semiorderedset<sdsimmutablestring, sdsview, true>>(20);
}
load_iter_data data = {cache, fn, privdata};
cache->m_spstorage = std::shared_ptr<IStorage>(pfactory->create(db, key_load_itr, (void*)&data));

View File

@ -49,8 +49,11 @@ class semiorderedset
}
public:
semiorderedset()
semiorderedset(size_t bitsStart = 0)
{
if (bitsStart < bits_min)
bitsStart = bits_min;
bits = bitsStart;
m_data.resize((1ULL << bits));
}