From: Remi Gacogne Date: Fri, 27 Jun 2025 10:15:48 +0000 (+0200) Subject: lmdb-safe: Use unordered maps for the transaction maps X-Git-Tag: dnsdist-2.0.0-rc1~6^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F15776%2Fhead;p=thirdparty%2Fpdns.git lmdb-safe: Use unordered maps for the transaction maps We don't need the maps to be ordered, and unordered maps are usually slightly faster. Signed-off-by: Remi Gacogne (cherry picked from commit 883aec59cf56f9345b0a229ed7af35490a113494) --- diff --git a/ext/lmdb-safe/lmdb-safe.hh b/ext/lmdb-safe/lmdb-safe.hh index 2f19124c69..294fba6bae 100644 --- a/ext/lmdb-safe/lmdb-safe.hh +++ b/ext/lmdb-safe/lmdb-safe.hh @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include @@ -111,8 +111,8 @@ public: private: std::mutex d_openmut; std::shared_mutex d_countmutex; - std::map> d_RWtransactionsOut; - std::map> d_ROtransactionsOut; + std::unordered_map> d_RWtransactionsOut; + std::unordered_map> d_ROtransactionsOut; }; std::shared_ptr getMDBEnv(const char* fname, int flags, int mode, uint64_t mapsizeMB=(sizeof(void *)==4) ? 100 : 16000);