forked from MassiveAtoms/hashmap-bench
we can test 19 libs now!!!
This commit is contained in:
179
src/includes/prepare.h
Normal file
179
src/includes/prepare.h
Normal file
@ -0,0 +1,179 @@
|
||||
|
||||
#ifndef PREPARE_H
|
||||
#define PREPARE_H
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
// hashmaps and hash
|
||||
#include <unordered_map>
|
||||
#include <sparsehash/sparse_hash_map>
|
||||
#include <sparsehash/dense_hash_map>
|
||||
#include "./3thparty/abseil-cpp/absl/container/node_hash_map.h"
|
||||
#include "./3thparty/abseil-cpp/absl/container/flat_hash_map.h"
|
||||
#include "./3thparty/abseil-cpp/absl/hash/hash.h"
|
||||
#include "./3thparty/tsl/sparse_map.h"
|
||||
#include "./3thparty/tsl/array_map.h"
|
||||
#include "./3thparty/tsl/ordered_map.h"
|
||||
#include "./3thparty/tsl/robin_map.h"
|
||||
#include "./3thparty/tsl/hopscotch_map.h"
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include "./3thparty/skarupke/bytell_hash_map.hpp"
|
||||
#include "./3thparty/skarupke/flat_hash_map.hpp"
|
||||
#include "./3thparty/skarupke/unordered_map.hpp"
|
||||
#include "./3thparty/parallel_hashmap/phmap.h"
|
||||
#include "./3thparty/emilib/hash_map.hpp"
|
||||
#include "3thparty/robinhood/robin_hood.h"
|
||||
|
||||
using std::string;
|
||||
using absl::Hash;
|
||||
|
||||
|
||||
// since my testing is based on this hashmap, this one doesn't need no prep
|
||||
void prepare(std::unordered_map<int, int>& map,int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(std::unordered_map<string, string>& map,int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
|
||||
// goooooogle
|
||||
void prepare(google::sparse_hash_map<int, int>& map, int size){
|
||||
map.set_deleted_key(0);
|
||||
}
|
||||
void prepare(google::sparse_hash_map<string, string>& map, int size){
|
||||
map.set_deleted_key("");
|
||||
}
|
||||
|
||||
|
||||
void prepare(google::dense_hash_map<int, int>& map, int size){
|
||||
map.set_empty_key(0);
|
||||
map.set_deleted_key(-1);
|
||||
}
|
||||
void prepare(google::dense_hash_map<string, string>& map, int size){
|
||||
map.set_deleted_key("a");
|
||||
map.set_empty_key("");
|
||||
}
|
||||
|
||||
//absl
|
||||
void prepare(absl::node_hash_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(absl::node_hash_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
|
||||
void prepare(absl::flat_hash_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(absl::flat_hash_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
// tessil
|
||||
void prepare(tsl::sparse_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(tsl::sparse_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
void prepare(tsl::array_map<int, int>& map, int size){
|
||||
// map.reserve(size);
|
||||
}
|
||||
void prepare(tsl::array_map<string, string>& map, int size){
|
||||
// map.reserve(size);
|
||||
}
|
||||
|
||||
void prepare(tsl::ordered_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(tsl::ordered_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
void prepare(tsl::robin_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(tsl::robin_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
void prepare(tsl::hopscotch_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(tsl::hopscotch_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
// booooooost
|
||||
void prepare(boost::unordered_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(boost::unordered_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
// skarupke's maps
|
||||
void prepare(ska::bytell_hash_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(ska::bytell_hash_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
void prepare(ska::flat_hash_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(ska::flat_hash_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
void prepare(ska::unordered_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(ska::unordered_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
// Gregory Popovitch' paralel hashmaps
|
||||
void prepare(phmap::parallel_flat_hash_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(phmap::parallel_flat_hash_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
void prepare(phmap::parallel_node_hash_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(phmap::parallel_node_hash_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
// emilib (Emil Ernerfeld library)
|
||||
void prepare(emilib::HashMap<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(emilib::HashMap<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
// martin robinhood
|
||||
void prepare(robin_hood::unordered_flat_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(robin_hood::unordered_flat_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
void prepare(robin_hood::unordered_node_map<int, int>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
void prepare(robin_hood::unordered_node_map<string, string>& map, int size){
|
||||
map.reserve(size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* TESTS_H */
|
Reference in New Issue
Block a user