Fix induction (again). Now it's 176 bytes per key
All checks were successful
Tests / Release [gcc] total: 932, passed: 932
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc,aarch64] total: 931, passed: 931
Tests / Coverage total: 930, passed: 930
weaselab/conflict-set/pipeline/head This commit looks good

This commit is contained in:
2024-03-13 07:26:49 -07:00
parent ef802b8acd
commit b779c0f6f7

View File

@@ -265,20 +265,22 @@ std::string getSearchPathPrintable(Node *n);
// Bound memory usage following the analysis in the ART paper
constexpr int kBytesPerKey = 120;
constexpr int kBytesPerKey = 176;
constexpr int kMinSavingsPerNode = 120;
constexpr int kMinChildrenNode4 = 2;
constexpr int kMinChildrenNode16 = 5;
constexpr int kMinChildrenNode48 = 17;
constexpr int kMinChildrenNode256 = 49;
static_assert(sizeof(Node256) + kBytesPerKey <=
kMinChildrenNode256 * kBytesPerKey);
static_assert(sizeof(Node48) + kBytesPerKey <=
kMinChildrenNode48 * kBytesPerKey);
static_assert(sizeof(Node16) + kBytesPerKey <=
kMinChildrenNode16 * kBytesPerKey);
static_assert(sizeof(Node4) + kBytesPerKey <= kMinChildrenNode4 * kBytesPerKey);
static_assert(sizeof(Node0) <= kBytesPerKey);
static_assert(sizeof(Node256) + kMinSavingsPerNode <=
kMinChildrenNode256 * kMinSavingsPerNode);
static_assert(sizeof(Node48) + kMinSavingsPerNode <=
kMinChildrenNode48 * kMinSavingsPerNode);
static_assert(sizeof(Node16) + kMinSavingsPerNode <=
kMinChildrenNode16 * kMinSavingsPerNode);
static_assert(sizeof(Node4) + kMinSavingsPerNode <=
kMinChildrenNode4 * kMinSavingsPerNode);
static_assert(sizeof(Node0) + kMinSavingsPerNode <= kBytesPerKey);
// setOldestVersion will additionally try to maintain this property:
// `max(children, 1) * length >= capacity`