[benchmark_tool] Added -count command line flag (how many benchmarks to run)

This commit is contained in:
Alex Zolotarev 2011-08-27 23:01:25 +03:00 committed by Alex Zolotarev
parent c8ea0f9b2b
commit e175caa98a
4 changed files with 17 additions and 9 deletions

View file

@ -2,4 +2,5 @@
#include "../../std/string.hpp"
void RunFeaturesLoadingBenchmark(string const & file);
/// @param[in] count number of times to run benchmark
void RunFeaturesLoadingBenchmark(string const & file, size_t count);

View file

@ -1,6 +1,6 @@
# Map library tests.
TARGET = map_benchmark
TARGET = benchmark_tool
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app

View file

@ -82,7 +82,7 @@ namespace
}
}
void RunFeaturesLoadingBenchmark(string const & file)
void RunFeaturesLoadingBenchmark(string const & file, size_t count)
{
model::FeaturesFetcher src;
src.InitClassificator();

View file

@ -1,16 +1,23 @@
#include "../../base/SRC_FIRST.hpp"
#include "api.hpp"
#include "../../3party/gflags/src/gflags/gflags.h"
DEFINE_string(input, "", "Data file name.");
DEFINE_string(input, "", "MWM file name in the data directory");
DEFINE_int32(count, 3, "How many times to run benchmark");
int main(int argc, char ** argv)
{
google::ParseCommandLineFlags(&argc, &argv, true);
google::SetUsageMessage("MWM benchmarking tool");
if (argc < 2)
{
google::ShowUsageWithFlagsRestrict(argv[0], "main");
return 0;
}
google::ParseCommandLineFlags(&argc, &argv, false);
if (!FLAGS_input.empty())
RunFeaturesLoadingBenchmark(FLAGS_input, FLAGS_count);
RunFeaturesLoadingBenchmark(FLAGS_input);
return 0;
}