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