diff options
author | Alex Zolotarev <deathbaba@gmail.com> | 2011-08-28 00:01:25 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:22:39 +0300 |
commit | e175caa98a5a30f54421b59aaa125352a29a1c8e (patch) | |
tree | 6877bee5f5c8676fff7a9369d1c26da72009c594 /map/benchmark_tool | |
parent | c8ea0f9b2bbb7e31e69b75581d880a6894224bb2 (diff) |
[benchmark_tool] Added -count command line flag (how many benchmarks to run)
Diffstat (limited to 'map/benchmark_tool')
-rw-r--r-- | map/benchmark_tool/api.hpp | 3 | ||||
-rw-r--r-- | map/benchmark_tool/benchmark_tool.pro | 2 | ||||
-rw-r--r-- | map/benchmark_tool/features_loading.cpp | 2 | ||||
-rw-r--r-- | map/benchmark_tool/main.cpp | 19 |
4 files changed, 17 insertions, 9 deletions
diff --git a/map/benchmark_tool/api.hpp b/map/benchmark_tool/api.hpp index 27025cd740..1e9b56ebfa 100644 --- a/map/benchmark_tool/api.hpp +++ b/map/benchmark_tool/api.hpp @@ -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); diff --git a/map/benchmark_tool/benchmark_tool.pro b/map/benchmark_tool/benchmark_tool.pro index 91cf9caa41..71117646ea 100644 --- a/map/benchmark_tool/benchmark_tool.pro +++ b/map/benchmark_tool/benchmark_tool.pro @@ -1,6 +1,6 @@ # Map library tests. -TARGET = map_benchmark +TARGET = benchmark_tool CONFIG += console CONFIG -= app_bundle TEMPLATE = app diff --git a/map/benchmark_tool/features_loading.cpp b/map/benchmark_tool/features_loading.cpp index 6770bf340d..aeda097f96 100644 --- a/map/benchmark_tool/features_loading.cpp +++ b/map/benchmark_tool/features_loading.cpp @@ -82,7 +82,7 @@ namespace } } -void RunFeaturesLoadingBenchmark(string const & file) +void RunFeaturesLoadingBenchmark(string const & file, size_t count) { model::FeaturesFetcher src; src.InitClassificator(); diff --git a/map/benchmark_tool/main.cpp b/map/benchmark_tool/main.cpp index 068dbd6920..8e9d5cbc89 100644 --- a/map/benchmark_tool/main.cpp +++ b/map/benchmark_tool/main.cpp @@ -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; } |