Files
poco/Data/SQLParser/benchmark/benchmark_utils.h
Matej Kenda 8a4a2955d5 Use nullptr in C++ code (solves #4348) (#5043)
* chore(CppParser): 0, NULL --> nullptr

* chore(Crypto): 0, NULL --> nullptr

* chore(DNSSD): 0, NULL --> nullptr

* chore(Encodings): 0, NULL --> nullptr

* chore(CppUnit): Correct indentation.

* chore(Foundation): 0, NULL --> nullptr

* chore(CMake): Always warn about wrong nullptr usage when compiling with GCC or CLang

* chore(Net): 0, NULL --> nullptr

* chore(Foundation): 0, NULL --> nullptr

* chore(Data): 0, NULL --> nullptr

* chore(macOS): 0, NULL --> nullptr

* chore(XML): 0, NULL --> nullptr

* chore(Zip): 0, NULL --> nullptr

* chore(Util): 0, NULL --> nullptr

* chore(Net/NetSSL): 0, NULL --> nullptr

* chore(Bonjour): 0, NULL --> nullptr

* chore(MongoDB, Redis): 0, NULL --> nullptr

* chore(Poco): 0, NULL --> nullptr

* chore(Win32): 0, NULL --> nullptr

* chore(CMake): Only warn about nullptr when verbose warnings are enabled.

* Potential fix for code scanning alert no. 1634: Guarded Free

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* chore(Net): Fix warning reported by gitlab.

* chore(gitlab CI): attempt to clean to gain disk space on the runner.

* chore(gitlab CI): Run build with  --parallel 4, correct docker cleanup.

---------

Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-10-30 15:20:53 +01:00

41 lines
976 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