Compare commits
3
Commits
v0.0.13
...
5e06a30357
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e06a30357 | ||
|
|
cb6e4292f2 | ||
|
|
154a48ded0 |
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.18)
|
cmake_minimum_required(VERSION 3.18)
|
||||||
project(
|
project(
|
||||||
conflict-set
|
conflict-set
|
||||||
VERSION 0.0.13
|
VERSION 0.0.14
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
"A data structure for optimistic concurrency control on ranges of bitwise-lexicographically-ordered keys."
|
"A data structure for optimistic concurrency control on ranges of bitwise-lexicographically-ordered keys."
|
||||||
HOMEPAGE_URL "https://git.weaselab.dev/weaselab/conflict-set"
|
HOMEPAGE_URL "https://git.weaselab.dev/weaselab/conflict-set"
|
||||||
|
|||||||
+57
-1
@@ -4073,6 +4073,62 @@ struct __attribute__((visibility("default"))) PeakPrinter {
|
|||||||
|
|
||||||
#ifdef ENABLE_MAIN
|
#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() {
|
void printTree() {
|
||||||
int64_t writeVersion = 0;
|
int64_t writeVersion = 0;
|
||||||
ConflictSet::Impl cs{writeVersion};
|
ConflictSet::Impl cs{writeVersion};
|
||||||
@@ -4094,7 +4150,7 @@ void printTree() {
|
|||||||
debugPrintDot(stdout, cs.root, &cs);
|
debugPrintDot(stdout, cs.root, &cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void) { printTree(); }
|
int main(void) { benchScan1<16>(); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_FUZZ
|
#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