1#include "benchmark_runner.hpp"
2#include "duckdb_benchmark_macro.hpp"
3#include "duckdb/main/appender.hpp"
4
5using namespace duckdb;
6using namespace std;
7
8DUCKDB_BENCHMARK(SELECT1Memory, "[storage]")
9void Load(DuckDBBenchmarkState *state) override {
10}
11void RunBenchmark(DuckDBBenchmarkState *state) override {
12 for (int32_t i = 0; i < 50000; i++) {
13 state->conn.Query("SELECT 1");
14 }
15}
16string VerifyResult(QueryResult *result) override {
17 return string();
18}
19string BenchmarkInfo() override {
20 return "Run the query \"SELECT 1\" 50K times in in-memory mode";
21}
22FINISH_BENCHMARK(SELECT1Memory)
23
24DUCKDB_BENCHMARK(SELECT1Disk, "[storage]")
25void Load(DuckDBBenchmarkState *state) override {
26}
27void RunBenchmark(DuckDBBenchmarkState *state) override {
28 for (int32_t i = 0; i < 50000; i++) {
29 state->conn.Query("SELECT 1");
30 }
31}
32string VerifyResult(QueryResult *result) override {
33 return string();
34}
35bool InMemory() override {
36 return false;
37}
38string BenchmarkInfo() override {
39 return "Run the query \"SELECT 1\" 50K times in in-memory mode";
40}
41FINISH_BENCHMARK(SELECT1Disk)
42