Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b1c710953 | |||
| ebf281220b | |||
| 6051b2fb2e |
@@ -358,21 +358,6 @@ void benchWorstCaseForRadixRangeRead() {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void benchMetrics() {
|
|
||||||
ankerl::nanobench::Bench bench;
|
|
||||||
ConflictSet cs{0};
|
|
||||||
|
|
||||||
int count;
|
|
||||||
ConflictSet::MetricsV1 *m;
|
|
||||||
cs.getMetricsV1(&m, &count);
|
|
||||||
bench.batch(count);
|
|
||||||
bench.run("fetch metric", [&]() {
|
|
||||||
for (int i = 0; i < count; ++i) {
|
|
||||||
m[i].getValue();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void benchCreateAndDestroy() {
|
void benchCreateAndDestroy() {
|
||||||
ankerl::nanobench::Bench bench;
|
ankerl::nanobench::Bench bench;
|
||||||
|
|
||||||
@@ -382,6 +367,5 @@ void benchCreateAndDestroy() {
|
|||||||
int main(void) {
|
int main(void) {
|
||||||
benchConflictSet();
|
benchConflictSet();
|
||||||
benchWorstCaseForRadixRangeRead();
|
benchWorstCaseForRadixRangeRead();
|
||||||
benchMetrics();
|
|
||||||
benchCreateAndDestroy();
|
benchCreateAndDestroy();
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -1111,7 +1111,8 @@ Node *&getOrCreateChild(Node *&self, uint8_t index, WriteContext *tls) {
|
|||||||
memmove(self16->index + i + 1, self16->index + i,
|
memmove(self16->index + i + 1, self16->index + i,
|
||||||
self->numChildren - (i + 1));
|
self->numChildren - (i + 1));
|
||||||
memmove(self16->children + i + 1, self16->children + i,
|
memmove(self16->children + i + 1, self16->children + i,
|
||||||
(self->numChildren - (i + 1)) * sizeof(self16->children[0]));
|
(self->numChildren - (i + 1)) *
|
||||||
|
sizeof(self16->children[0])); // NOLINT
|
||||||
memmove(self16->childMaxVersion + i + 1, self16->childMaxVersion + i,
|
memmove(self16->childMaxVersion + i + 1, self16->childMaxVersion + i,
|
||||||
(self->numChildren - (i + 1)) *
|
(self->numChildren - (i + 1)) *
|
||||||
sizeof(self16->childMaxVersion[0]));
|
sizeof(self16->childMaxVersion[0]));
|
||||||
|
|||||||
@@ -98,6 +98,13 @@ void ConflictSet::setOldestVersion(int64_t oldestVersion) {
|
|||||||
|
|
||||||
int64_t ConflictSet::getBytes() const { return -1; }
|
int64_t ConflictSet::getBytes() const { return -1; }
|
||||||
|
|
||||||
|
void ConflictSet::getMetricsV1(MetricsV1 **metrics, int *count) const {
|
||||||
|
*metrics = nullptr;
|
||||||
|
*count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double ConflictSet::MetricsV1::getValue() const { return 0; }
|
||||||
|
|
||||||
ConflictSet::ConflictSet(int64_t oldestVersion)
|
ConflictSet::ConflictSet(int64_t oldestVersion)
|
||||||
: impl(new(safe_malloc(sizeof(Impl))) Impl{oldestVersion}) {}
|
: impl(new(safe_malloc(sizeof(Impl))) Impl{oldestVersion}) {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user