From 43c534f3ee144c394576561cf2a002f8def5443c Mon Sep 17 00:00:00 2001 From: TinyAtoms Date: Wed, 5 Feb 2020 09:42:40 -0300 Subject: [PATCH] done --- CMakeLists.txt | 2 +- main.cpp | 34 +++++++++++++++++++++++++++++++--- src/includes/aggregate_tests.h | 3 ++- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dbd1223..3bdca81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.15) project(another_studproject) 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 ./src/includes/generator.h ./src/generator.cpp diff --git a/main.cpp b/main.cpp index e181d26..263f5c6 100644 --- a/main.cpp +++ b/main.cpp @@ -12,8 +12,36 @@ // 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) int main() { - string_test(std::unordered_map{}, 10); - int_test(std::unordered_map{}, 10); + time_point start_test = steady_clock::now(); + string_test(std::unordered_map{}, 1); // process gets killed for sizes >35000 + int_test(std::unordered_map{}, 1); + time_point end_test = steady_clock::now(); + std::cout << "1 run all tests 1 map: " << duration_cast(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 } diff --git a/src/includes/aggregate_tests.h b/src/includes/aggregate_tests.h index 6d7c6d4..92ba37d 100644 --- a/src/includes/aggregate_tests.h +++ b/src/includes/aggregate_tests.h @@ -10,7 +10,8 @@ std::vector sizes = { 50000, 100000, 150000, 200000, 250000, 300000, 350000, 400000, 500000, 600000, 700000, 800000, 900000, 1000000, 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 };