Compare commits
3 Commits
11c3ca6766
...
2b1c710953
Author | SHA1 | Date | |
---|---|---|---|
2b1c710953 | |||
ebf281220b | |||
6051b2fb2e |
16
Bench.cpp
16
Bench.cpp
@@ -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() {
|
||||
ankerl::nanobench::Bench bench;
|
||||
|
||||
@@ -382,6 +367,5 @@ void benchCreateAndDestroy() {
|
||||
int main(void) {
|
||||
benchConflictSet();
|
||||
benchWorstCaseForRadixRangeRead();
|
||||
benchMetrics();
|
||||
benchCreateAndDestroy();
|
||||
}
|
||||
|
@@ -1111,7 +1111,8 @@ Node *&getOrCreateChild(Node *&self, uint8_t index, WriteContext *tls) {
|
||||
memmove(self16->index + i + 1, self16->index + i,
|
||||
self->numChildren - (i + 1));
|
||||
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,
|
||||
(self->numChildren - (i + 1)) *
|
||||
sizeof(self16->childMaxVersion[0]));
|
||||
|
@@ -98,6 +98,13 @@ void ConflictSet::setOldestVersion(int64_t oldestVersion) {
|
||||
|
||||
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)
|
||||
: impl(new(safe_malloc(sizeof(Impl))) Impl{oldestVersion}) {}
|
||||
|
||||
|
Reference in New Issue
Block a user