aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/filecas.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-12-04 08:37:05 -0500
committerGitHub <[email protected]>2023-12-04 14:37:05 +0100
commit8269e0616cf4333fd1007ccd8a7b1dac09743e11 (patch)
tree7f2e974acb09b66cd556ea0d43c62281aa73941b /src/zenstore/filecas.cpp
parentmemory usage estimation for memcached entries (#586) (diff)
downloadzen-8269e0616cf4333fd1007ccd8a7b1dac09743e11.tar.xz
zen-8269e0616cf4333fd1007ccd8a7b1dac09743e11.zip
reserve vectors in gcv2 upfront / load factor for robin_map (#582)
* reserve vectors in gcv2 upfront * set max load factor for robin_map indexes to reduce memory usage * set min load factor for robin_map indexes to allow them to shrink
Diffstat (limited to 'src/zenstore/filecas.cpp')
-rw-r--r--src/zenstore/filecas.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/zenstore/filecas.cpp b/src/zenstore/filecas.cpp
index aeca01dd1..5da612e30 100644
--- a/src/zenstore/filecas.cpp
+++ b/src/zenstore/filecas.cpp
@@ -128,8 +128,14 @@ FileCasStrategy::ShardingHelper::ShardingHelper(const std::filesystem::path& Roo
//////////////////////////////////////////////////////////////////////////
+static const float IndexMinLoadFactor = 0.2f;
+static const float IndexMaxLoadFactor = 0.7f;
+
FileCasStrategy::FileCasStrategy(GcManager& Gc) : m_Log(logging::Get("filecas")), m_Gc(Gc)
{
+ m_Index.min_load_factor(IndexMinLoadFactor);
+ m_Index.max_load_factor(IndexMaxLoadFactor);
+
m_Gc.AddGcStorage(this);
m_Gc.AddGcReferenceStore(*this);
}