From 66a751611aee3aa23a770cb47a7ae805bce1d9a3 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Mon, 13 Jan 2025 16:35:10 -0500 Subject: [PATCH] Comments on std hashmap bucket defaults. --- include/bitcoin/node/chasers/chaser_organize.hpp | 2 ++ include/bitcoin/node/protocols/protocol_block_in.hpp | 1 + include/bitcoin/node/sessions/session_outbound.hpp | 1 + 3 files changed, 4 insertions(+) diff --git a/include/bitcoin/node/chasers/chaser_organize.hpp b/include/bitcoin/node/chasers/chaser_organize.hpp index 35ff8b84..33779667 100644 --- a/include/bitcoin/node/chasers/chaser_organize.hpp +++ b/include/bitcoin/node/chasers/chaser_organize.hpp @@ -172,6 +172,8 @@ class chaser_organize // These are protected by strand. chain_state::ptr state_{}; + + // TODO: optimize, default bucket count is around 8. block_tree tree_{}; }; diff --git a/include/bitcoin/node/protocols/protocol_block_in.hpp b/include/bitcoin/node/protocols/protocol_block_in.hpp index 31ac5edf..4109ce0f 100644 --- a/include/bitcoin/node/protocols/protocol_block_in.hpp +++ b/include/bitcoin/node/protocols/protocol_block_in.hpp @@ -56,6 +56,7 @@ class BCN_API protocol_block_in struct track { + // TODO: optimize, default bucket count is around 8. hashmap ids{}; size_t announced{}; system::hash_digest last{}; diff --git a/include/bitcoin/node/sessions/session_outbound.hpp b/include/bitcoin/node/sessions/session_outbound.hpp index b83d740b..abee30b3 100644 --- a/include/bitcoin/node/sessions/session_outbound.hpp +++ b/include/bitcoin/node/sessions/session_outbound.hpp @@ -54,6 +54,7 @@ class BCN_API session_outbound const float allowed_deviation_; // This is protected by strand. + // TODO: optimize, default bucket count is around 8. std::unordered_map speeds_{}; };