diff options
| author | Tyge Løvset <[email protected]> | 2021-03-01 16:26:51 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-03-01 16:26:51 +0100 |
| commit | df259d54a43039f0cd2e4bbb168bf60a8dd97973 (patch) | |
| tree | fda12d24ad87e0cb2f9f5d471faf55bed993f4b2 /benchmarks/shootout2_cmap.cpp | |
| parent | 3add074518345bf3b6b965c3f79bd0d35079891b (diff) | |
| download | STC-modified-df259d54a43039f0cd2e4bbb168bf60a8dd97973.tar.gz STC-modified-df259d54a43039f0cd2e4bbb168bf60a8dd97973.zip | |
Update exteral maps
Diffstat (limited to 'benchmarks/shootout2_cmap.cpp')
| -rw-r--r-- | benchmarks/shootout2_cmap.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/benchmarks/shootout2_cmap.cpp b/benchmarks/shootout2_cmap.cpp index 13905a3f..33d9dad8 100644 --- a/benchmarks/shootout2_cmap.cpp +++ b/benchmarks/shootout2_cmap.cpp @@ -7,21 +7,18 @@ #ifdef __cplusplus
#include <unordered_map>
-#include "others/bytell_hash_map.hpp"
#include "others/robin_hood.hpp"
-#include "others/hopscotch_map.h"
+#include "others/skarupke/bytell_hash_map.hpp"
+#include "others/tsl/hopscotch_map.h"
+#include "others/tsl/robin_map.h"
#include "others/sparsepp/spp.h"
template<typename C> inline void destroy_me(C& c) { C().swap(c); }
#endif
// Visual Studio: compile with -TP to force C++: cl -TP -EHsc -O2 benchmark.c
-static inline uint32_t fibonacci_hash(const void* data, size_t len) {
- return (uint32_t) (((*(const uint64_t *) data) * 11400714819323198485llu) >> 24);
-}
-
// cmap and khash template expansion
-using_cmap(ii, int64_t, int64_t, c_default_equals, fibonacci_hash); // c_default_hash);
+using_cmap(ii, int64_t, int64_t, c_default_equals, c_default_hash64); // c_default_hash);
KHASH_MAP_INIT_INT64(ii, int64_t)
@@ -104,6 +101,18 @@ stc64_t rng; #define HMAP_CLEAR(X) UMAP_CLEAR(X)
#define HMAP_DTOR(X) UMAP_DTOR(X)
+#define OMAP_SETUP(X, Key, Value) tsl::robin_map<Key, Value> map; map.max_load_factor(max_load_factor)
+#define OMAP_PUT(X, key, val) UMAP_PUT(X, key, val)
+#define OMAP_EMPLACE(X, key, val) UMAP_EMPLACE(X, key, val)
+#define OMAP_FIND(X, key) UMAP_FIND(X, key)
+#define OMAP_ERASE(X, key) UMAP_ERASE(X, key)
+#define OMAP_FOR(X, i) UMAP_FOR(X, i)
+#define OMAP_ITEM(X, i) UMAP_ITEM(X, i)
+#define OMAP_SIZE(X) UMAP_SIZE(X)
+#define OMAP_BUCKETS(X) UMAP_BUCKETS(X)
+#define OMAP_CLEAR(X) UMAP_CLEAR(X)
+#define OMAP_DTOR(X) UMAP_DTOR(X)
+
#define RMAP_SETUP(X, Key, Value) robin_hood::unordered_map<Key, Value> map
#define RMAP_PUT(X, key, val) UMAP_PUT(X, key, val)
#define RMAP_EMPLACE(X, key, val) UMAP_EMPLACE(X, key, val)
|
