diff --git a/benchmark/word_size.cpp b/benchmark/word_size.cpp index d054efcd..f109096f 100644 --- a/benchmark/word_size.cpp +++ b/benchmark/word_size.cpp @@ -64,6 +64,20 @@ template BOOST_NOINLINE void test_word_size( Map& map, std::chrono::s std::cout << std::endl; } +template BOOST_NOINLINE void test_iteration( Map& map, std::chrono::steady_clock::time_point & t1 ) +{ + std::size_t s = 0; + + for( auto const& x: map ) + { + s += x.second; + } + + print_time( t1, "Iterate and sum counts", s, map.size() ); + + std::cout << std::endl; +} + // counting allocator static std::size_t s_alloc_bytes = 0; @@ -136,6 +150,8 @@ template class Map> BOOST_NOINLINE void test( char const* lab record rec = { label, 0, s_alloc_bytes, s_alloc_count }; + test_iteration( map, t1 ); + auto tN = std::chrono::steady_clock::now(); std::cout << "Total: " << ( tN - t0 ) / 1ms << " ms\n\n";