From 43e42994cbe6d0d17c6c1c9454f3ba544d92007e Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Mon, 14 Apr 2025 08:50:17 +0200 Subject: [PATCH] refactor(block_cache): phmap is as least as fast as F14 (and smaller) --- src/reader/internal/block_cache.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/reader/internal/block_cache.cpp b/src/reader/internal/block_cache.cpp index 560dba6b..ea36c4ce 100644 --- a/src/reader/internal/block_cache.cpp +++ b/src/reader/internal/block_cache.cpp @@ -44,10 +44,11 @@ #include #include -#include #include #include +#include + #include #include #include @@ -783,18 +784,19 @@ class block_cache_ final : public block_cache::impl { using lru_type = folly::EvictingCacheMap>; + template + using fast_map_type = phmap::flat_hash_map; mutable std::mutex mx_; mutable lru_type cache_; - mutable folly::F14FastMap>> + mutable fast_map_type>> active_; std::thread tidy_thread_; std::condition_variable tidy_cond_; bool tidy_running_{false}; mutable std::mutex mx_dec_; - mutable folly::F14FastMap> + mutable fast_map_type> decompressing_; mutable std::atomic blocks_created_{0};