diff --git a/bench/bench_alloc_shrink_to_fit.cpp b/bench/bench_alloc_shrink_to_fit.cpp index 7a9ae62..d8a9404 100644 --- a/bench/bench_alloc_shrink_to_fit.cpp +++ b/bench/bench_alloc_shrink_to_fit.cpp @@ -47,7 +47,7 @@ template<> struct get_allocator_name class MyInt { - int int_; + std::size_t int_; //Use a type that will grow on 64 bit machines public: MyInt(int i = 0) : int_(i){} @@ -133,10 +133,18 @@ int main(int argc, const char *argv[]) { #define SINGLE_TEST #ifndef SINGLE_TEST + #ifdef NDEBUG unsigned int numit [] = { 100, 1000, 10000 }; + #else + unsigned int numit [] = { 10, 100, 1000 }; + #endif unsigned int numele [] = { 10000, 2000, 500 }; #else + #ifdef NDEBUG unsigned int numit [] = { 500 }; + #else + unsigned int numit [] = { 50 }; + #endif unsigned int numele [] = { 2000 }; #endif diff --git a/bench/bench_set.hpp b/bench/bench_set.hpp index f606b38..cdc3043 100644 --- a/bench/bench_set.hpp +++ b/bench/bench_set.hpp @@ -76,12 +76,17 @@ vector random_range_string; void fill_range_strings() { + string model_s; + model_s.append(sizeof(string), '*'); + //sorted_unique_range_int sorted_unique_range_string.resize(NElements); + std::stringstream sstr; + for(std::size_t i = 0, max = sorted_unique_range_string.size(); i != max; ++i){ - std::stringstream sstr; + sstr.str(std::string()); sstr << std::setfill('0') << std::setw(10) << i; - sorted_unique_range_string[i] = "really_long_long_prefix_to_ssb_and_increase_comparison_costs_"; + sorted_unique_range_string[i] = model_s; const std::string &s = sstr.str(); sorted_unique_range_string[i].append(s.begin(), s.end()); }