mirror of
https://github.com/mariadb-corporation/mariadb-connector-cpp.git
synced 2025-07-22 18:27:20 +00:00
[misc] adding batch benchmark with client rewrite
This commit is contained in:
@ -326,8 +326,8 @@ BENCHMARK(BM_DO_1000_PARAMS)->Name(TYPE + " DO 1000 params")->ThreadRange(1, MAX
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void BM_INSERT_BATCH_WITH_PREPARE(benchmark::State& state) {
|
static void BM_INSERT_BATCH_CLIENT_REWRITE(benchmark::State& state) {
|
||||||
sql::Connection *conn = connect("");
|
sql::Connection *conn = connect("?rewriteBatchedStatements=true");
|
||||||
int numOperation = 0;
|
int numOperation = 0;
|
||||||
for (auto _ : state) {
|
for (auto _ : state) {
|
||||||
insert_batch_with_prepare(state, conn);
|
insert_batch_with_prepare(state, conn);
|
||||||
@ -337,7 +337,18 @@ BENCHMARK(BM_DO_1000_PARAMS)->Name(TYPE + " DO 1000 params")->ThreadRange(1, MAX
|
|||||||
delete conn;
|
delete conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void BM_INSERT_BATCH_WITH_PREPARE(benchmark::State& state) {
|
||||||
|
sql::Connection *conn = connect("?useServerPrepStmts=true");
|
||||||
|
int numOperation = 0;
|
||||||
|
for (auto _ : state) {
|
||||||
|
insert_batch_with_prepare(state, conn);
|
||||||
|
numOperation++;
|
||||||
|
}
|
||||||
|
state.counters[OPERATION_PER_SECOND_LABEL] = benchmark::Counter(numOperation, benchmark::Counter::kIsRate);
|
||||||
|
delete conn;
|
||||||
|
}
|
||||||
BENCHMARK(BM_INSERT_BATCH_WITH_PREPARE)->Name(TYPE + " insert batch looping execute")->ThreadRange(1, MAX_THREAD)->UseRealTime()->Setup(setup_insert_batch);
|
BENCHMARK(BM_INSERT_BATCH_WITH_PREPARE)->Name(TYPE + " insert batch looping execute")->ThreadRange(1, MAX_THREAD)->UseRealTime()->Setup(setup_insert_batch);
|
||||||
|
BENCHMARK(BM_INSERT_BATCH_CLIENT_REWRITE)->Name(TYPE + " insert batch client rewrite")->ThreadRange(1, MAX_THREAD)->UseRealTime()->Setup(setup_insert_batch);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BENCHMARK_MAIN();
|
BENCHMARK_MAIN();
|
||||||
|
Reference in New Issue
Block a user