aboutsummaryrefslogtreecommitdiffhomepage
path: root/benchmark
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2022-03-09 18:03:56 +0300
committerlevlam <levlam@telegram.org>2022-03-09 18:03:56 +0300
commit07bb12965302afa69d0bf4771641d453e08fb3a3 (patch)
tree1f3eabb21b998124845f7fb356accedf84b433fb /benchmark
parent15520c5dddbc742b0c6b032e8901e94fda94f3a6 (diff)
Move FlatHashTable implementation to FlatHashTable.h.
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/hashmap_build.cpp2
-rw-r--r--benchmark/hashset_memory.cpp8
2 files changed, 6 insertions, 4 deletions
diff --git a/benchmark/hashmap_build.cpp b/benchmark/hashmap_build.cpp
index 4f8a3daf6..7d63acb71 100644
--- a/benchmark/hashmap_build.cpp
+++ b/benchmark/hashmap_build.cpp
@@ -5,8 +5,6 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/utils/FlatHashMap.h"
-#include "td/utils/FlatHashMapChunks.h"
-#include "td/utils/FlatHashMapLinear.h"
#ifdef SCOPE_EXIT
#undef SCOPE_EXIT
diff --git a/benchmark/hashset_memory.cpp b/benchmark/hashset_memory.cpp
index 3ed7e6393..aacd18247 100644
--- a/benchmark/hashset_memory.cpp
+++ b/benchmark/hashset_memory.cpp
@@ -11,7 +11,7 @@
#include "td/utils/common.h"
#include "td/utils/FlatHashMap.h"
#include "td/utils/FlatHashMapChunks.h"
-#include "td/utils/FlatHashMapLinear.h"
+#include "td/utils/FlatHashTable.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/port/Stat.h"
@@ -25,6 +25,7 @@
#include <absl/container/flat_hash_map.h>
#include <array>
#include <folly/container/F14Map.h>
+#include <functional>
#include <map>
#include <unordered_map>
@@ -164,8 +165,11 @@ void print_memory_stats(td::Slice name) {
}
}
+template <class KeyT, class ValueT, class HashT = std::hash<KeyT>, class EqT = std::equal_to<KeyT>>
+using FlatHashMapImpl = td::FlatHashTable<td::MapNode<KeyT, ValueT>, HashT, EqT>;
+
#define FOR_EACH_TABLE(F) \
- F(td::FlatHashMapImpl) \
+ F(FlatHashMapImpl) \
F(folly::F14FastMap) \
F(absl::flat_hash_map) \
F(std::unordered_map) \