From 8f0ffd0a659f6a2dfb8287fa6b88a89bbd6246e8 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 30 Sep 2022 16:38:11 +0300 Subject: [PATCH] Reduce MAX_STORAGE_SIZE for wait free hash tables to reduce split_storage time. --- tdutils/td/utils/WaitFreeHashMap.h | 2 +- tdutils/td/utils/WaitFreeHashSet.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tdutils/td/utils/WaitFreeHashMap.h b/tdutils/td/utils/WaitFreeHashMap.h index f38f01fe3..04ff05bba 100644 --- a/tdutils/td/utils/WaitFreeHashMap.h +++ b/tdutils/td/utils/WaitFreeHashMap.h @@ -19,7 +19,7 @@ class WaitFreeHashMap { using Storage = FlatHashMap; static constexpr size_t MAX_STORAGE_COUNT = 1 << 11; static_assert((MAX_STORAGE_COUNT & (MAX_STORAGE_COUNT - 1)) == 0, ""); - static constexpr size_t MAX_STORAGE_SIZE = 1 << 17; + static constexpr size_t MAX_STORAGE_SIZE = 1 << 16; static_assert((MAX_STORAGE_SIZE & (MAX_STORAGE_SIZE - 1)) == 0, ""); Storage default_map_; diff --git a/tdutils/td/utils/WaitFreeHashSet.h b/tdutils/td/utils/WaitFreeHashSet.h index 4341e73a0..8212f7393 100644 --- a/tdutils/td/utils/WaitFreeHashSet.h +++ b/tdutils/td/utils/WaitFreeHashSet.h @@ -19,7 +19,7 @@ class WaitFreeHashSet { using Storage = FlatHashSet; static constexpr size_t MAX_STORAGE_COUNT = 1 << 11; static_assert((MAX_STORAGE_COUNT & (MAX_STORAGE_COUNT - 1)) == 0, ""); - static constexpr size_t MAX_STORAGE_SIZE = 1 << 17; + static constexpr size_t MAX_STORAGE_SIZE = 1 << 16; static_assert((MAX_STORAGE_SIZE & (MAX_STORAGE_SIZE - 1)) == 0, ""); Storage default_set_;