diff --git a/benchmark/uint64.cpp b/benchmark/uint64.cpp index a2c1b3a3..4abc4a3e 100644 --- a/benchmark/uint64.cpp +++ b/benchmark/uint64.cpp @@ -5,12 +5,14 @@ #define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING #include +#include #include #include #include #include #include #include +#include #ifdef HAVE_ABSEIL # include "absl/container/node_hash_map.h" # include "absl/container/flat_hash_map.h" @@ -311,6 +313,29 @@ template using std_unordered_map = template using boost_unordered_map = boost::unordered_map, std::equal_to, allocator_for>; +template struct map_types +{ + using key_type = Key; + using value_type = std::pair; + static auto& extract(const value_type& x) { return x.first; } +}; + +template +using boost_unordered_detail_foa_table = + boost::unordered::detail::foa::table, + absl::container_internal::hash_default_hash, std::equal_to, + allocator_for >; + +template +using boost_unordered_flat_map = boost::unordered::unordered_flat_map, std::equal_to, + allocator_for >; + +template +using rc15_flat_map = foa_unordered_rc_map, std::equal_to, + allocator_for >; + #ifdef HAVE_ABSEIL template using absl_node_hash_map = @@ -347,6 +372,9 @@ int main() test( "std::unordered_map" ); test( "boost::unordered_map" ); + test( "boost_unordered_detail_foa_table" ); + test( "boost::unordered_flat_map" ); + test( "rc15_flat_map" ); test( "multi_index_map" ); #ifdef HAVE_ABSEIL @@ -374,7 +402,7 @@ int main() for( auto const& x: times ) { - std::cout << std::setw( 25 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; + std::cout << std::setw( 34 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; } }