poco/Data/SQLParser/benchmark/benchmark_utils.h
Aleksandar Fabijanic ef688babc2
SQLParser not included in the release archive #4453 (#4456)
* fix(SQLParser): move to Data dir; add extradirs, remove vs 140,150 build scripts generation

* fix(ActiveRecord): Makefile #4453

* fix(Data): Make SQLParser internal

* fix(build): ODBC Makefile and Data libs CmakeLists #4453

* fix(build): Data libs CMakeLists #4453

* fix(build): regenerate VS projects #4453

* fix(CppUnit): remove Foundation dependency

* fix(SQLParser): remove leftover unnecessary includes

* fix(SQLParser): remove fwd header #4453

* fix(PocoDoc): remove SQLParser from include list

* fix(mkrelease): remove 140,150 vs projects

* fix(SQLParser): Disable SQL parsing by default #4462

* fix(test): Disable SQL parsing by default #4462

* Fix detection of odbc and apache2 for Fedora (#4461)

* Fixed transaction handling in MySQL test when SQL parser is switched off

* chore(ParallelSocketAcceptor): remove unnecessary include and using from header

---------

Co-authored-by: Matej Kenda <matejken@gmail.com>
Co-authored-by: topazus <77263945+topazus@users.noreply.github.com>
Co-authored-by: Friedrich Wilckens <frwilckens@gmail.com>
2024-02-16 09:33:14 +01:00

41 lines
982 B
C++

#ifndef __BENCHMARK_UTILS_H__
#define __BENCHMARK_UTILS_H__
#include "benchmark/benchmark.h"
size_t getNumTokens(const std::string& query);
void BM_TokenizeBenchmark(benchmark::State& st, const std::string& query);
void BM_ParseBenchmark(benchmark::State& st, const std::string& query);
std::string readFileContents(const std::string& file_path);
#define TIME_DIFF(end, start)\
std::chrono::duration_cast<std::chrono::duration<double>>(end - start);
#define NOW()\
std::chrono::high_resolution_clock::now();
#define PARSE_QUERY_BENCHMARK(name, query)\
static void name(benchmark::State& st) {\
BM_ParseBenchmark(st, query);\
}\
BENCHMARK(name);
#define TOKENIZE_QUERY_BENCHMARK(name, query)\
static void name(benchmark::State& st) {\
BM_TokenizeBenchmark(st, query);\
}\
BENCHMARK(name);
#define BENCHMARK_QUERY(test_name, query)\
TOKENIZE_QUERY_BENCHMARK(test_name##Tokenize, query)\
PARSE_QUERY_BENCHMARK(test_name##Parse, query)
#endif