forked from weaselab/conflict-set
Fix induction (again). Now it's 176 bytes per key
This commit is contained in:
+11
-9
@@ -265,20 +265,22 @@ std::string getSearchPathPrintable(Node *n);
|
|||||||
|
|
||||||
// Bound memory usage following the analysis in the ART paper
|
// 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 kMinChildrenNode4 = 2;
|
||||||
constexpr int kMinChildrenNode16 = 5;
|
constexpr int kMinChildrenNode16 = 5;
|
||||||
constexpr int kMinChildrenNode48 = 17;
|
constexpr int kMinChildrenNode48 = 17;
|
||||||
constexpr int kMinChildrenNode256 = 49;
|
constexpr int kMinChildrenNode256 = 49;
|
||||||
|
|
||||||
static_assert(sizeof(Node256) + kBytesPerKey <=
|
static_assert(sizeof(Node256) + kMinSavingsPerNode <=
|
||||||
kMinChildrenNode256 * kBytesPerKey);
|
kMinChildrenNode256 * kMinSavingsPerNode);
|
||||||
static_assert(sizeof(Node48) + kBytesPerKey <=
|
static_assert(sizeof(Node48) + kMinSavingsPerNode <=
|
||||||
kMinChildrenNode48 * kBytesPerKey);
|
kMinChildrenNode48 * kMinSavingsPerNode);
|
||||||
static_assert(sizeof(Node16) + kBytesPerKey <=
|
static_assert(sizeof(Node16) + kMinSavingsPerNode <=
|
||||||
kMinChildrenNode16 * kBytesPerKey);
|
kMinChildrenNode16 * kMinSavingsPerNode);
|
||||||
static_assert(sizeof(Node4) + kBytesPerKey <= kMinChildrenNode4 * kBytesPerKey);
|
static_assert(sizeof(Node4) + kMinSavingsPerNode <=
|
||||||
static_assert(sizeof(Node0) <= kBytesPerKey);
|
kMinChildrenNode4 * kMinSavingsPerNode);
|
||||||
|
static_assert(sizeof(Node0) + kMinSavingsPerNode <= kBytesPerKey);
|
||||||
|
|
||||||
// setOldestVersion will additionally try to maintain this property:
|
// setOldestVersion will additionally try to maintain this property:
|
||||||
// `max(children, 1) * length >= capacity`
|
// `max(children, 1) * length >= capacity`
|
||||||
|
|||||||
Reference in New Issue
Block a user