diff --git a/benchmark/string.cpp b/benchmark/string.cpp index e2267552..d2930455 100644 --- a/benchmark/string.cpp +++ b/benchmark/string.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #ifdef HAVE_ABSEIL # include "absl/container/node_hash_map.h" # include "absl/container/flat_hash_map.h" @@ -74,7 +75,7 @@ static void init_indices() } } -template void test_insert( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_insert( Map& map, std::chrono::steady_clock::time_point & t1 ) { for( unsigned i = 1; i <= N; ++i ) { @@ -93,7 +94,7 @@ template void test_insert( Map& map, std::chrono::steady_clock::time_ std::cout << std::endl; } -template void test_lookup( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_lookup( Map& map, std::chrono::steady_clock::time_point & t1 ) { std::uint32_t s; @@ -126,7 +127,7 @@ template void test_lookup( Map& map, std::chrono::steady_clock::time_ std::cout << std::endl; } -template void test_iteration( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_iteration( Map& map, std::chrono::steady_clock::time_point & t1 ) { auto it = map.begin(); @@ -147,7 +148,7 @@ template void test_iteration( Map& map, std::chrono::steady_clock::ti std::cout << std::endl; } -template void test_erase( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_erase( Map& map, std::chrono::steady_clock::time_point & t1 ) { for( unsigned i = 1; i <= N; ++i ) { @@ -172,7 +173,7 @@ template void test_erase( Map& map, std::chrono::steady_clock::time_p static std::vector< std::pair > times; -template class Map> void test( char const* label ) +template class Map> BOOST_NOINLINE void test( char const* label ) { std::cout << label << ":\n\n"; diff --git a/benchmark/uint32.cpp b/benchmark/uint32.cpp index 1105582c..6aa51a7c 100644 --- a/benchmark/uint32.cpp +++ b/benchmark/uint32.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #ifdef HAVE_ABSEIL # include "absl/container/node_hash_map.h" # include "absl/container/flat_hash_map.h" @@ -63,7 +64,7 @@ static void init_indices() } } -template void test_insert( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_insert( Map& map, std::chrono::steady_clock::time_point & t1 ) { for( unsigned i = 1; i <= N; ++i ) { @@ -89,7 +90,7 @@ template void test_insert( Map& map, std::chrono::steady_clock::time_ std::cout << std::endl; } -template void test_lookup( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_lookup( Map& map, std::chrono::steady_clock::time_point & t1 ) { std::uint32_t s; @@ -135,7 +136,7 @@ template void test_lookup( Map& map, std::chrono::steady_clock::time_ std::cout << std::endl; } -template void test_iteration( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_iteration( Map& map, std::chrono::steady_clock::time_point & t1 ) { auto it = map.begin(); @@ -156,7 +157,7 @@ template void test_iteration( Map& map, std::chrono::steady_clock::ti std::cout << std::endl; } -template void test_erase( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_erase( Map& map, std::chrono::steady_clock::time_point & t1 ) { for( unsigned i = 1; i <= N; ++i ) { @@ -188,7 +189,7 @@ template void test_erase( Map& map, std::chrono::steady_clock::time_p static std::vector< std::pair > times; -template class Map> void test( char const* label ) +template class Map> BOOST_NOINLINE void test( char const* label ) { std::cout << label << ":\n\n"; diff --git a/benchmark/uint64.cpp b/benchmark/uint64.cpp index 2b677280..1ec69fbc 100644 --- a/benchmark/uint64.cpp +++ b/benchmark/uint64.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #ifdef HAVE_ABSEIL # include "absl/container/node_hash_map.h" # include "absl/container/flat_hash_map.h" @@ -63,7 +64,7 @@ static void init_indices() } } -template void test_insert( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_insert( Map& map, std::chrono::steady_clock::time_point & t1 ) { for( unsigned i = 1; i <= N; ++i ) { @@ -89,7 +90,7 @@ template void test_insert( Map& map, std::chrono::steady_clock::time_ std::cout << std::endl; } -template void test_lookup( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_lookup( Map& map, std::chrono::steady_clock::time_point & t1 ) { std::uint64_t s; @@ -135,7 +136,7 @@ template void test_lookup( Map& map, std::chrono::steady_clock::time_ std::cout << std::endl; } -template void test_iteration( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_iteration( Map& map, std::chrono::steady_clock::time_point & t1 ) { auto it = map.begin(); @@ -156,7 +157,7 @@ template void test_iteration( Map& map, std::chrono::steady_clock::ti std::cout << std::endl; } -template void test_erase( Map& map, std::chrono::steady_clock::time_point & t1 ) +template BOOST_NOINLINE void test_erase( Map& map, std::chrono::steady_clock::time_point & t1 ) { for( unsigned i = 1; i <= N; ++i ) { @@ -188,7 +189,7 @@ template void test_erase( Map& map, std::chrono::steady_clock::time_p static std::vector< std::pair > times; -template class Map> void test( char const* label ) +template class Map> BOOST_NOINLINE void test( char const* label ) { std::cout << label << ":\n\n";