diff --git a/benchmark/string.cpp b/benchmark/string.cpp index 24ceb60a..0611ead5 100644 --- a/benchmark/string.cpp +++ b/benchmark/string.cpp @@ -18,6 +18,9 @@ #ifdef HAVE_TSL_ROBIN # include "tsl/robin_map.h" #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE +# include "ankerl/unordered_dense.h" +#endif #include #include #include @@ -307,6 +310,13 @@ template using tsl_robin_pg_map = #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE + +template using ankerl_unordered_dense_map = + ankerl::unordered_dense::map, std::equal_to, ::allocator< std::pair >>; + +#endif + // fnv1a_hash template struct fnv1a_hash_impl; @@ -393,6 +403,13 @@ template using tsl_robin_pg_map_fnv1a = #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE + +template using ankerl_unordered_dense_map_fnv1a = + ankerl::unordered_dense::map, ::allocator< std::pair >>; + +#endif + // int main() @@ -403,6 +420,12 @@ int main() test( "boost::unordered_map" ); test( "boost::unordered_flat_map" ); +#ifdef HAVE_ANKERL_UNORDERED_DENSE + + test( "ankerl::unordered_dense::map" ); + +#endif + #ifdef HAVE_ABSEIL test( "absl::node_hash_map" ); @@ -428,6 +451,12 @@ int main() test( "boost::unordered_map, FNV-1a" ); test( "boost::unordered_flat_map, FNV-1a" ); +#ifdef HAVE_ANKERL_UNORDERED_DENSE + + test( "ankerl::unordered_dense::map, FNV-1a" ); + +#endif + #ifdef HAVE_ABSEIL test( "absl::node_hash_map, FNV-1a" ); @@ -453,7 +482,7 @@ int main() for( auto const& x: times ) { - std::cout << std::setw( 35 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; + std::cout << std::setw( 38 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; } } diff --git a/benchmark/string_view.cpp b/benchmark/string_view.cpp index 728884d1..a7774ffe 100644 --- a/benchmark/string_view.cpp +++ b/benchmark/string_view.cpp @@ -18,6 +18,9 @@ #ifdef HAVE_TSL_ROBIN # include "tsl/robin_map.h" #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE +# include "ankerl/unordered_dense.h" +#endif #include #include #include @@ -308,6 +311,13 @@ template using tsl_robin_pg_map = #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE + +template using ankerl_unordered_dense_map = + ankerl::unordered_dense::map, std::equal_to, ::allocator< std::pair >>; + +#endif + // fnv1a_hash template struct fnv1a_hash_impl; @@ -394,6 +404,13 @@ template using tsl_robin_pg_map_fnv1a = #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE + +template using ankerl_unordered_dense_map_fnv1a = + ankerl::unordered_dense::map, ::allocator< std::pair >>; + +#endif + // int main() @@ -404,6 +421,12 @@ int main() test( "boost::unordered_map" ); test( "boost::unordered_flat_map" ); +#ifdef HAVE_ANKERL_UNORDERED_DENSE + + test( "ankerl::unordered_dense::map" ); + +#endif + #ifdef HAVE_ABSEIL test( "absl::node_hash_map" ); @@ -429,6 +452,12 @@ int main() test( "boost::unordered_map, FNV-1a" ); test( "boost::unordered_flat_map, FNV-1a" ); +#ifdef HAVE_ANKERL_UNORDERED_DENSE + + test( "ankerl::unordered_dense::map, FNV-1a" ); + +#endif + #ifdef HAVE_ABSEIL test( "absl::node_hash_map, FNV-1a" ); @@ -454,7 +483,7 @@ int main() for( auto const& x: times ) { - std::cout << std::setw( 35 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; + std::cout << std::setw( 38 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; } } diff --git a/benchmark/uint32.cpp b/benchmark/uint32.cpp index ff7ac031..8034b0c4 100644 --- a/benchmark/uint32.cpp +++ b/benchmark/uint32.cpp @@ -19,6 +19,9 @@ #ifdef HAVE_TSL_ROBIN # include "tsl/robin_map.h" #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE +# include "ankerl/unordered_dense.h" +#endif #include #include #include @@ -324,6 +327,13 @@ template using tsl_robin_pg_map = #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE + +template using ankerl_unordered_dense_map = + ankerl::unordered_dense::map, std::equal_to, ::allocator< std::pair >>; + +#endif + int main() { init_indices(); @@ -332,6 +342,12 @@ int main() test( "boost::unordered_map" ); test( "boost::unordered_flat_map" ); +#ifdef HAVE_ANKERL_UNORDERED_DENSE + + test( "ankerl::unordered_dense::map" ); + +#endif + #ifdef HAVE_ABSEIL test( "absl::node_hash_map" ); @@ -357,7 +373,7 @@ int main() for( auto const& x: times ) { - std::cout << std::setw( 27 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; + std::cout << std::setw( 30 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; } } diff --git a/benchmark/uint64.cpp b/benchmark/uint64.cpp index e7721065..cb98c2ec 100644 --- a/benchmark/uint64.cpp +++ b/benchmark/uint64.cpp @@ -19,6 +19,9 @@ #ifdef HAVE_TSL_ROBIN # include "tsl/robin_map.h" #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE +# include "ankerl/unordered_dense.h" +#endif #include #include #include @@ -324,6 +327,13 @@ template using tsl_robin_pg_map = #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE + +template using ankerl_unordered_dense_map = + ankerl::unordered_dense::map, std::equal_to, ::allocator< std::pair >>; + +#endif + int main() { init_indices(); @@ -332,6 +342,12 @@ int main() test( "boost::unordered_map" ); test( "boost::unordered_flat_map" ); +#ifdef HAVE_ANKERL_UNORDERED_DENSE + + test( "ankerl::unordered_dense::map" ); + +#endif + #ifdef HAVE_ABSEIL test( "absl::node_hash_map" ); @@ -357,7 +373,7 @@ int main() for( auto const& x: times ) { - std::cout << std::setw( 27 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; + std::cout << std::setw( 30 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; } } diff --git a/benchmark/uuid.cpp b/benchmark/uuid.cpp index a1338781..d7036b58 100644 --- a/benchmark/uuid.cpp +++ b/benchmark/uuid.cpp @@ -14,6 +14,9 @@ # include "absl/container/node_hash_map.h" # include "absl/container/flat_hash_map.h" #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE +# include "ankerl/unordered_dense.h" +#endif #include #include #include @@ -349,6 +352,13 @@ template using absl_flat_hash_map = #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE + +template using ankerl_unordered_dense_map = + ankerl::unordered_dense::map, std::equal_to, ::allocator< std::pair >>; + +#endif + int main() { init_indices(); @@ -357,6 +367,12 @@ int main() test( "boost::unordered_map" ); test( "boost::unordered_flat_map" ); +#ifdef HAVE_ANKERL_UNORDERED_DENSE + + test( "ankerl::unordered_dense::map" ); + +#endif + #ifdef HAVE_ABSEIL test( "absl::node_hash_map" ); @@ -368,7 +384,7 @@ int main() for( auto const& x: times ) { - std::cout << std::setw( 27 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; + std::cout << std::setw( 30 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; } } diff --git a/benchmark/word_count.cpp b/benchmark/word_count.cpp index be48d5f1..19c83ef5 100644 --- a/benchmark/word_count.cpp +++ b/benchmark/word_count.cpp @@ -12,6 +12,9 @@ # include "absl/container/node_hash_map.h" # include "absl/container/flat_hash_map.h" #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE +# include "ankerl/unordered_dense.h" +#endif #include #include #include @@ -229,6 +232,13 @@ template using absl_flat_hash_map = #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE + +template using ankerl_unordered_dense_map = + ankerl::unordered_dense::map, std::equal_to, ::allocator< std::pair >>; + +#endif + // fnv1a_hash template struct fnv1a_hash_impl; @@ -295,6 +305,13 @@ template using absl_flat_hash_map_fnv1a = #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE + +template using ankerl_unordered_dense_map_fnv1a = + ankerl::unordered_dense::map, ::allocator< std::pair >>; + +#endif + // int main() @@ -305,6 +322,12 @@ int main() test( "boost::unordered_map" ); test( "boost::unordered_flat_map" ); +#ifdef HAVE_ANKERL_UNORDERED_DENSE + + test( "ankerl::unordered_dense::map" ); + +#endif + #ifdef HAVE_ABSEIL test( "absl::node_hash_map" ); @@ -316,6 +339,12 @@ int main() test( "boost::unordered_map, FNV-1a" ); test( "boost::unordered_flat_map, FNV-1a" ); +#ifdef HAVE_ANKERL_UNORDERED_DENSE + + test( "ankerl::unordered_dense::map, FNV-1a" ); + +#endif + #ifdef HAVE_ABSEIL test( "absl::node_hash_map, FNV-1a" ); @@ -327,7 +356,7 @@ int main() for( auto const& x: times ) { - std::cout << std::setw( 35 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; + std::cout << std::setw( 38 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; } } diff --git a/benchmark/word_size.cpp b/benchmark/word_size.cpp index f109096f..a02371e5 100644 --- a/benchmark/word_size.cpp +++ b/benchmark/word_size.cpp @@ -11,6 +11,9 @@ # include "absl/container/node_hash_map.h" # include "absl/container/flat_hash_map.h" #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE +# include "ankerl/unordered_dense.h" +#endif #include #include #include @@ -182,6 +185,13 @@ template using absl_flat_hash_map = #endif +#ifdef HAVE_ANKERL_UNORDERED_DENSE + +template using ankerl_unordered_dense_map = + ankerl::unordered_dense::map, std::equal_to, ::allocator< std::pair >>; + +#endif + int main() { init_words(); @@ -190,6 +200,12 @@ int main() test( "boost::unordered_map" ); test( "boost::unordered_flat_map" ); +#ifdef HAVE_ANKERL_UNORDERED_DENSE + + test( "ankerl::unordered_dense::map" ); + +#endif + #ifdef HAVE_ABSEIL test( "absl::node_hash_map" ); @@ -201,7 +217,7 @@ int main() for( auto const& x: times ) { - std::cout << std::setw( 27 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; + std::cout << std::setw( 30 ) << ( x.label_ + ": " ) << std::setw( 5 ) << x.time_ << " ms, " << std::setw( 9 ) << x.bytes_ << " bytes in " << x.count_ << " allocations\n"; } }