mirror of
https://github.com/boostorg/container.git
synced 2025-08-03 06:24:26 +02:00
Make debug benchmarks faster reducing iterations.
This commit is contained in:
@@ -47,7 +47,7 @@ template<> struct get_allocator_name<AllocatorPlusV1>
|
||||
|
||||
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
|
||||
|
||||
|
@@ -76,12 +76,17 @@ vector<string> 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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user