only half of hw threads

This commit is contained in:
Valentin Balaschenko
2025-05-21 14:51:30 +01:00
parent c6c20ca671
commit c1713b8773

View File

@@ -253,12 +253,11 @@ public:
partitioned_unordered_map( partitioned_unordered_map(
std::optional<std::size_t> partitions = std::nullopt) std::optional<std::size_t> partitions = std::nullopt)
{ {
// Set partitions to the number of hardware threads if the parameter // Set partitions to use half of the number of hardware threads if the
// is either empty or set to 0. // parameter is either empty or set to 0.
partitions_ = std::size_t{std::thread::hardware_concurrency() / 2}; partitions_ = partitions && *partitions
// partitions && *partitions ? *partitions
// ? *partitions : std::size_t{std::thread::hardware_concurrency() / 2};
// : std::thread::hardware_concurrency();
map_.resize(partitions_); map_.resize(partitions_);
XRPL_ASSERT( XRPL_ASSERT(
partitions_, partitions_,