diff --git a/benchmark/string.cpp b/benchmark/string.cpp index 3da8103e..6ce5b775 100644 --- a/benchmark/string.cpp +++ b/benchmark/string.cpp @@ -35,7 +35,7 @@ constexpr int K = 10; static std::vector indices1, indices2, indices3; -static std::string make_index( std::uint32_t x ) +static std::string make_index( unsigned x ) { char buffer[ 64 ]; std::snprintf( buffer, sizeof(buffer), "pfx_%u_sfx", x ); @@ -281,9 +281,19 @@ template<> struct fnv1a_hash_impl<64> struct fnv1a_hash: fnv1a_hash_impl< std::numeric_limits::digits > {}; +template using std_unordered_map_fnv1a = + std::unordered_map; + template using boost_unordered_map_fnv1a = boost::unordered_map; +template using multi_index_map_fnv1a = multi_index_container< + pair, + indexed_by< + hashed_unique< member, K, &pair::first>, fnv1a_hash > + > +>; + // int main() @@ -291,9 +301,11 @@ int main() init_indices(); test( "std::unordered_map" ); + test( "std::unordered_map, FNV-1a" ); test( "boost::unordered_map" ); test( "boost::unordered_map, FNV-1a" ); test( "multi_index_map" ); + test( "multi_index_map, FNV-1a" ); // test( "std::map" );