From df259d54a43039f0cd2e4bbb168bf60a8dd97973 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Mon, 1 Mar 2021 16:26:51 +0100 Subject: Update exteral maps --- benchmarks/shootout2_cmap.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'benchmarks/shootout2_cmap.cpp') 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 -#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 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 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 map #define RMAP_PUT(X, key, val) UMAP_PUT(X, key, val) #define RMAP_EMPLACE(X, key, val) UMAP_EMPLACE(X, key, val) -- cgit v1.2.3