2020-02-03 18:10:29 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <functional>
|
|
|
|
#include <fstream>
|
|
|
|
|
|
|
|
#include "./src/includes/aggregate_tests.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// typedef std::unordered_map<int,int> map;
|
2020-02-03 22:21:35 +00:00
|
|
|
// we can use ^ to switch the map implementations to that
|
|
|
|
// we can add some cli handling so we can specify which maps to tests (or all)
|
2020-02-03 18:10:29 +00:00
|
|
|
int main() {
|
2020-02-05 12:42:40 +00:00
|
|
|
time_point<steady_clock> start_test = steady_clock::now();
|
|
|
|
string_test(std::unordered_map<std::string, std::string>{}, 1); // process gets killed for sizes >35000
|
|
|
|
int_test(std::unordered_map<int, int>{}, 1);
|
|
|
|
time_point<steady_clock> end_test = steady_clock::now();
|
|
|
|
std::cout << "1 run all tests 1 map: " << duration_cast<minutes>(end_test-start_test).count() << " minutes";
|
|
|
|
// test takes 52 mins for 10 runs for one hashmap
|
|
|
|
// so it'll take ~3 hours per map if we want 30 runs per test
|
|
|
|
/* if the other maps have about the same operation times ************
|
|
|
|
|
|
|
|
// maps to benchmark:
|
|
|
|
1. Google dense_hash_map
|
|
|
|
2. Google sparse_hash_map
|
|
|
|
3. folly F14ValueMap
|
|
|
|
4. folly F14NodeMap
|
|
|
|
5. Tessil/ordered-map
|
|
|
|
6. Tessil/array-hash
|
|
|
|
7. Tessil/hopscotch-map
|
|
|
|
8. Tessil/sparse-map/
|
|
|
|
9. abseil node_hash_map
|
|
|
|
10. abseil flat_hash_map
|
|
|
|
11. Glib GHashTable
|
|
|
|
12. Boost unordered_map
|
|
|
|
13. Qt QHash
|
|
|
|
14. skarupke/flat_hash_map
|
|
|
|
15. greg7mdp/sparsepp
|
|
|
|
16. greg7mdp /parallel-hashmap (phmap::flat_hash_map and phmap::node_hash_map)
|
|
|
|
17. emilk/emilib emilib::hashmap
|
|
|
|
18. martinus robin_hood::unordered_node_map
|
|
|
|
19. martinus/robin-hood-hashing/
|
|
|
|
20. skarupke /flat_hash_map
|
|
|
|
*/
|
2020-02-03 22:21:35 +00:00
|
|
|
|
|
|
|
}
|