From e91990f03bce8e769c6f34a137b77db8a5e4c9f3 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Mon, 13 Jan 2025 16:35:51 -0500 Subject: [PATCH] Comments on std hashmap bucket defaults. --- include/bitcoin/network/async/desubscriber.hpp | 2 ++ include/bitcoin/network/net/hosts.hpp | 2 ++ include/bitcoin/network/p2p.hpp | 1 + 3 files changed, 5 insertions(+) diff --git a/include/bitcoin/network/async/desubscriber.hpp b/include/bitcoin/network/async/desubscriber.hpp index d2988e7f..5fa3de37 100644 --- a/include/bitcoin/network/async/desubscriber.hpp +++ b/include/bitcoin/network/async/desubscriber.hpp @@ -74,6 +74,8 @@ class desubscriber final // These are not thread safe. bool stopped_{ false }; + + // TODO: optimize, default bucket count is around 8. std::map map_{}; }; diff --git a/include/bitcoin/network/net/hosts.hpp b/include/bitcoin/network/net/hosts.hpp index 88567377..390a0e2e 100644 --- a/include/bitcoin/network/net/hosts.hpp +++ b/include/bitcoin/network/net/hosts.hpp @@ -140,6 +140,8 @@ class BCT_API hosts // These are not thread safe. buffer buffer_; bool stopped_{ true }; + + // TODO: optimize, default bucket count is around 8. std::unordered_set authorities_{}; }; diff --git a/include/bitcoin/network/p2p.hpp b/include/bitcoin/network/p2p.hpp index a12cbfb3..da76e181 100644 --- a/include/bitcoin/network/p2p.hpp +++ b/include/bitcoin/network/p2p.hpp @@ -294,6 +294,7 @@ class BCT_API p2p object_key keys_{}; // Guards loopback. + // TODO: optimize, default bucket count is around 8. std::unordered_set nonces_{}; };