Welcome to mirror list, hosted at ThFree Co, Russian Federation.

main.cpp « benchmark_tool « map - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ce11784b1a7b0acc8b58032f7d573b81a27fe99e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "map/benchmark_tool/api.hpp"

#include "indexer/classificator_loader.hpp"
#include "indexer/data_header.hpp"

#include "std/iostream.hpp"

#include "3party/gflags/src/gflags/gflags.h"


DEFINE_string(input, "", "MWM file name in the data directory");
DEFINE_int32(lowS, 10, "Low processing scale");
DEFINE_int32(highS, 17, "High processing scale");
DEFINE_bool(print_scales, false, "Print geometry scales for MWM and exit");


int main(int argc, char ** argv)
{
  classificator::Load();

  google::SetUsageMessage("MWM benchmarking tool");
  if (argc < 2)
  {
    google::ShowUsageWithFlagsRestrict(argv[0], "main");
    return 0;
  }

  google::ParseCommandLineFlags(&argc, &argv, false);

  if (FLAGS_print_scales)
  {
    feature::DataHeader h(FLAGS_input);
    cout << "Scales with geometry: ";
    for (size_t i = 0; i < h.GetScalesCount(); ++i)
      cout << h.GetScale(i) << " ";
    cout << endl;
    return 0;
  }

  if (!FLAGS_input.empty())
  {
    using namespace bench;

    AllResult res;
    RunFeaturesLoadingBenchmark(FLAGS_input, make_pair(FLAGS_lowS, FLAGS_highS), res);

    res.Print();
  }

  return 0;
}