From 552ba5d8857e276274ca30425c3a60cc7e22e6e2 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 26 Jun 2025 01:34:39 +0300 Subject: [PATCH] B-tree is slower... --- src/blockstore/blockstore_heap.cpp | 9 +++++++-- src/blockstore/blockstore_heap.h | 4 ++-- src/blockstore/blockstore_impl.cpp | 2 ++ src/blockstore/blockstore_init.cpp | 1 + src/blockstore/blockstore_open.cpp | 1 + src/test/test_heap.cpp | 1 + 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/blockstore/blockstore_heap.cpp b/src/blockstore/blockstore_heap.cpp index 336f4502..7423a0f6 100644 --- a/src/blockstore/blockstore_heap.cpp +++ b/src/blockstore/blockstore_heap.cpp @@ -2,8 +2,13 @@ // Copyright (c) Vitaliy Filippov, 2025+ // License: VNPL-1.1 (see README.md for details) -#include "blockstore_heap.h" +#include +#include +#include +#include + +#include "blockstore_heap.h" #include "../util/allocator.h" #include "../util/crc32c.h" #include "../util/malloc_or_die.h" @@ -813,7 +818,7 @@ void blockstore_heap_t::reshard(pool_id_t pool, uint32_t pg_count, uint32_t pg_s return; } uint64_t pool_id = (uint64_t)pool; - std::map>> new_shards; + std::map>> new_shards; auto sh_it = block_index.lower_bound((pool_id << (64-POOL_ID_BITS))); while (sh_it != block_index.end() && (sh_it->first >> (64-POOL_ID_BITS)) == pool_id) { diff --git a/src/blockstore/blockstore_heap.h b/src/blockstore/blockstore_heap.h index eaaa7b8d..ab991fdb 100644 --- a/src/blockstore/blockstore_heap.h +++ b/src/blockstore/blockstore_heap.h @@ -11,7 +11,7 @@ #include #include "../client/object_id.h" -#include "../../cpp-btree/btree_map.h" +//#include "../../cpp-btree/btree_map.h" #include "blockstore_disk.h" #include "multilist.h" @@ -139,7 +139,7 @@ class blockstore_heap_t uint64_t next_lsn = 0; std::unordered_map pool_shard_settings; // PG => inode => stripe => block number - std::map>> block_index; + std::map>> block_index; std::vector block_info; allocator_t *data_alloc = NULL; multilist_index_t *meta_alloc = NULL; diff --git a/src/blockstore/blockstore_impl.cpp b/src/blockstore/blockstore_impl.cpp index a1713a7d..e4c1dbfe 100644 --- a/src/blockstore/blockstore_impl.cpp +++ b/src/blockstore/blockstore_impl.cpp @@ -1,6 +1,8 @@ // Copyright (c) Vitaliy Filippov, 2019+ // License: VNPL-1.1 (see README.md for details) +#include + #include "blockstore_impl.h" #include "blockstore_internal.h" #include "crc32c.h" diff --git a/src/blockstore/blockstore_init.cpp b/src/blockstore/blockstore_init.cpp index 4202ce92..4a8b3e80 100644 --- a/src/blockstore/blockstore_init.cpp +++ b/src/blockstore/blockstore_init.cpp @@ -1,6 +1,7 @@ // Copyright (c) Vitaliy Filippov, 2019+ // License: VNPL-1.1 (see README.md for details) +#include #include "blockstore_impl.h" #include "blockstore_internal.h" #include "str_util.h" diff --git a/src/blockstore/blockstore_open.cpp b/src/blockstore/blockstore_open.cpp index 95b0851a..d4c6f5e0 100644 --- a/src/blockstore/blockstore_open.cpp +++ b/src/blockstore/blockstore_open.cpp @@ -2,6 +2,7 @@ // License: VNPL-1.1 (see README.md for details) #include +#include #include "blockstore_impl.h" void blockstore_impl_t::parse_config(blockstore_config_t & config) diff --git a/src/test/test_heap.cpp b/src/test/test_heap.cpp index ff1ef485..c4c094bb 100644 --- a/src/test/test_heap.cpp +++ b/src/test/test_heap.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include "../util/malloc_or_die.h" #include "../util/allocator.h"