Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e06a30357 | ||
|
|
cb6e4292f2 | ||
|
|
154a48ded0 |
+1
-1
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
project(
|
||||
conflict-set
|
||||
VERSION 0.0.13
|
||||
VERSION 0.0.14
|
||||
DESCRIPTION
|
||||
"A data structure for optimistic concurrency control on ranges of bitwise-lexicographically-ordered keys."
|
||||
HOMEPAGE_URL "https://git.weaselab.dev/weaselab/conflict-set"
|
||||
|
||||
+57
-1
@@ -4073,6 +4073,62 @@ struct __attribute__((visibility("default"))) PeakPrinter {
|
||||
|
||||
#ifdef ENABLE_MAIN
|
||||
|
||||
#define ANKERL_NANOBENCH_IMPLEMENT
|
||||
#include "third_party/nanobench.h"
|
||||
|
||||
template <int kN> void benchRezero() {
|
||||
static_assert(kN % 16 == 0);
|
||||
ankerl::nanobench::Bench bench;
|
||||
InternalVersionT vs[kN];
|
||||
InternalVersionT zero;
|
||||
bench.run("rezero" + std::to_string(kN), [&]() {
|
||||
bench.doNotOptimizeAway(vs);
|
||||
bench.doNotOptimizeAway(zero);
|
||||
for (int i = 0; i < kN; i += 16) {
|
||||
rezero16(vs + i, zero);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
template <int kN> void benchScan1() {
|
||||
static_assert(kN % 16 == 0);
|
||||
ankerl::nanobench::Bench bench;
|
||||
InternalVersionT vs[kN];
|
||||
uint8_t is[kN];
|
||||
uint8_t begin;
|
||||
uint8_t end;
|
||||
InternalVersionT v;
|
||||
bench.run("scan" + std::to_string(kN), [&]() {
|
||||
bench.doNotOptimizeAway(vs);
|
||||
bench.doNotOptimizeAway(is);
|
||||
bench.doNotOptimizeAway(begin);
|
||||
bench.doNotOptimizeAway(end);
|
||||
bench.doNotOptimizeAway(v);
|
||||
for (int i = 0; i < kN; i += 16) {
|
||||
scan16</*kAVX512=*/true>(vs + i, is + i, begin, end, v);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
template <int kN> void benchScan2() {
|
||||
static_assert(kN % 16 == 0);
|
||||
ankerl::nanobench::Bench bench;
|
||||
InternalVersionT vs[kN];
|
||||
uint8_t is[kN];
|
||||
uint8_t begin;
|
||||
uint8_t end;
|
||||
InternalVersionT v;
|
||||
bench.run("scan" + std::to_string(kN), [&]() {
|
||||
bench.doNotOptimizeAway(vs);
|
||||
bench.doNotOptimizeAway(begin);
|
||||
bench.doNotOptimizeAway(end);
|
||||
bench.doNotOptimizeAway(v);
|
||||
for (int i = 0; i < kN; i += 16) {
|
||||
scan16</*kAVX512=*/true>(vs + i, begin, end, v);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void printTree() {
|
||||
int64_t writeVersion = 0;
|
||||
ConflictSet::Impl cs{writeVersion};
|
||||
@@ -4094,7 +4150,7 @@ void printTree() {
|
||||
debugPrintDot(stdout, cs.root, &cs);
|
||||
}
|
||||
|
||||
int main(void) { printTree(); }
|
||||
int main(void) { benchScan1<16>(); }
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FUZZ
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user