From c1713b87738dddc69799860404e2f302088f72c9 Mon Sep 17 00:00:00 2001 From: Valentin Balaschenko <13349202+vlntb@users.noreply.github.com> Date: Wed, 21 May 2025 14:51:30 +0100 Subject: [PATCH] only half of hw threads --- include/xrpl/basics/partitioned_unordered_map.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/xrpl/basics/partitioned_unordered_map.h b/include/xrpl/basics/partitioned_unordered_map.h index ee4ee3de12..01bcb1a2f3 100644 --- a/include/xrpl/basics/partitioned_unordered_map.h +++ b/include/xrpl/basics/partitioned_unordered_map.h @@ -253,12 +253,11 @@ public: partitioned_unordered_map( std::optional partitions = std::nullopt) { - // Set partitions to the number of hardware threads if the parameter - // is either empty or set to 0. - partitions_ = std::size_t{std::thread::hardware_concurrency() / 2}; - // partitions && *partitions - // ? *partitions - // : std::thread::hardware_concurrency(); + // Set partitions to use half of the number of hardware threads if the + // parameter is either empty or set to 0. + partitions_ = partitions && *partitions + ? *partitions + : std::size_t{std::thread::hardware_concurrency() / 2}; map_.resize(partitions_); XRPL_ASSERT( partitions_,