Add example augmented radix tree figure
All checks were successful
Tests / Release [gcc] total: 704, passed: 704
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap: Reference build: <a href="https://jenkins.weaselab.dev/job/weaselab/job/conflict-set/job/main/45//gcc">weaselab » conflict-set » main #45</a>
Tests / Coverage total: 702, passed: 702
weaselab/conflict-set/pipeline/head This commit looks good

This commit is contained in:
2024-02-29 16:35:07 -08:00
parent 946694b8a5
commit a4b03bc216
4 changed files with 57 additions and 9 deletions

View File

@@ -2232,13 +2232,24 @@ void printTree() {
ConflictSet::Impl cs{writeVersion};
ReferenceImpl refImpl{writeVersion};
Arena arena;
constexpr int kNumKeys = 5;
constexpr int kNumKeys = 4;
auto *write = new (arena) ConflictSet::WriteRange[kNumKeys];
for (int i = 0; i < kNumKeys; ++i) {
write[i].begin = toKey(arena, i);
write[i].end.len = 0;
write[i].writeVersion = ++writeVersion;
}
write[0].begin = "and"_s;
write[0].end = "ant"_s;
write[0].writeVersion = 1;
write[1].begin = "any"_s;
write[1].end.len = 0;
write[1].writeVersion = 2;
write[2].begin = "are"_s;
write[2].end.len = 0;
write[2].writeVersion = 3;
write[3].begin = "art"_s;
write[3].end.len = 0;
write[3].writeVersion = 4;
cs.addWrites(write, kNumKeys);
for (int i = 0; i < kNumKeys; ++i) {
write[i].writeVersion = ++writeVersion;
@@ -2251,6 +2262,8 @@ void printTree() {
#include "third_party/nanobench.h"
int main(void) {
printTree();
return 0;
ankerl::nanobench::Bench bench;
ConflictSet::Impl cs{0};
for (int j = 0; j < 256; ++j) {