done
This commit is contained in:
parent
81dc4804ec
commit
43c534f3ee
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.15)
|
|||||||
project(another_studproject)
|
project(another_studproject)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_FLAGS "-O3 -flto=thin")
|
set(CMAKE_CXX_FLAGS "-O3 -flto=thin -march=native")
|
||||||
add_executable(another_studproject
|
add_executable(another_studproject
|
||||||
./src/includes/generator.h
|
./src/includes/generator.h
|
||||||
./src/generator.cpp
|
./src/generator.cpp
|
||||||
|
34
main.cpp
34
main.cpp
@ -12,8 +12,36 @@
|
|||||||
// we can use ^ to switch the map implementations to that
|
// 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)
|
// we can add some cli handling so we can specify which maps to tests (or all)
|
||||||
int main() {
|
int main() {
|
||||||
string_test(std::unordered_map<std::string, std::string>{}, 10);
|
time_point<steady_clock> start_test = steady_clock::now();
|
||||||
int_test(std::unordered_map<int, int>{}, 10);
|
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
|
||||||
|
*/
|
||||||
|
|
||||||
// test takes 52 mins for 10 runs for 1 dict
|
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,8 @@ std::vector<int> sizes = {
|
|||||||
50000, 100000, 150000, 200000, 250000, 300000, 350000, 400000, 500000,
|
50000, 100000, 150000, 200000, 250000, 300000, 350000, 400000, 500000,
|
||||||
600000, 700000, 800000, 900000, 1000000,
|
600000, 700000, 800000, 900000, 1000000,
|
||||||
2000000, 3000000, 4000000, 5000000, 6000000, 7000000, 8000000, 9000000, 10000000,
|
2000000, 3000000, 4000000, 5000000, 6000000, 7000000, 8000000, 9000000, 10000000,
|
||||||
// 15000000, 20000000, 25000000, 30000000, 35000000, 40000000, 45000000, 50000000
|
15000000, 20000000, 25000000, 30000000, 35000000,
|
||||||
|
40000000, 45000000, 50000000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user