File: benchmark.cpp

package info (click to toggle)
poco 1.14.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 56,460 kB
  • sloc: cpp: 340,542; ansic: 245,601; makefile: 1,742; yacc: 1,005; sh: 698; sql: 312; lex: 282; xml: 128; perl: 29; python: 24
file content (28 lines) | stat: -rw-r--r-- 1,085 bytes parent folder | download
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
#include "benchmark/benchmark.h"

#include "benchmark_utils.h"
#include "queries.h"

int main(int argc, char** argv) {
  // Create parse and tokenize benchmarks for TPC-H queries.
  const auto tpch_queries = getTPCHQueries();
  for (const auto& query : tpch_queries) {
    std::string p_name = query.first + "-parse";
    benchmark::RegisterBenchmark(p_name.c_str(), &BM_ParseBenchmark, query.second);
    std::string t_name = query.first + "-tokenize";
    benchmark::RegisterBenchmark(t_name.c_str(), &BM_TokenizeBenchmark, query.second);
  }

  // Create parse and tokenize benchmarks for all queries in sql_queries array.
  for (unsigned i = 0; i < sql_queries.size(); ++i) {
    const auto& query = sql_queries[i];
    std::string p_name = getQueryName(i) + "-parse";
    benchmark::RegisterBenchmark(p_name.c_str(), &BM_ParseBenchmark, query.second);

    std::string t_name = getQueryName(i) + "-tokenize";
    benchmark::RegisterBenchmark(t_name.c_str(), &BM_TokenizeBenchmark, query.second);
  }

  benchmark::Initialize(&argc, argv);
  benchmark::RunSpecifiedBenchmarks();
}