Make debug benchmarks faster reducing iterations.

This commit is contained in:
Ion Gaztañaga
2014-07-20 14:43:58 +02:00
parent 941eb27e1d
commit 717959061e
2 changed files with 16 additions and 3 deletions

View File

@@ -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

View File

@@ -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);
for(std::size_t i = 0, max = sorted_unique_range_string.size(); i != max; ++i){
std::stringstream sstr;
for(std::size_t i = 0, max = sorted_unique_range_string.size(); i != max; ++i){
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());
}