Remove coalesce benchmark
Reviewers: teon.banek Reviewed By: teon.banek Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1712
This commit is contained in:
parent
ef53bd8eb7
commit
95ad542f19
@ -36,9 +36,6 @@ target_link_libraries(${test_prefix}map_concurrent mg-single-node kvstore_dummy_
|
|||||||
add_benchmark(data_structures/ring_buffer.cpp)
|
add_benchmark(data_structures/ring_buffer.cpp)
|
||||||
target_link_libraries(${test_prefix}ring_buffer mg-single-node kvstore_dummy_lib)
|
target_link_libraries(${test_prefix}ring_buffer mg-single-node kvstore_dummy_lib)
|
||||||
|
|
||||||
add_benchmark(query/eval.cpp)
|
|
||||||
target_link_libraries(${test_prefix}eval mg-single-node kvstore_dummy_lib)
|
|
||||||
|
|
||||||
add_benchmark(query/planner.cpp)
|
add_benchmark(query/planner.cpp)
|
||||||
target_link_libraries(${test_prefix}planner mg-single-node kvstore_dummy_lib)
|
target_link_libraries(${test_prefix}planner mg-single-node kvstore_dummy_lib)
|
||||||
|
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
#include <benchmark/benchmark.h>
|
|
||||||
|
|
||||||
#include "query/frontend/ast/ast.hpp"
|
|
||||||
#include "query/interpret/eval.hpp"
|
|
||||||
|
|
||||||
static void BenchmarkCoalesceCallWithNulls(benchmark::State &state) {
|
|
||||||
int64_t num_args = state.range(0);
|
|
||||||
query::AstStorage ast_storage;
|
|
||||||
std::vector<query::Expression *> arguments;
|
|
||||||
arguments.reserve(num_args);
|
|
||||||
for (int64_t i = 0; i < num_args; ++i) {
|
|
||||||
arguments.emplace_back(
|
|
||||||
ast_storage.Create<query::PrimitiveLiteral>(query::TypedValue::Null));
|
|
||||||
}
|
|
||||||
auto *function = ast_storage.Create<query::Function>("COALESCE", arguments);
|
|
||||||
query::Frame frame(0);
|
|
||||||
database::GraphDbAccessor *dba = nullptr;
|
|
||||||
query::Context context(*dba);
|
|
||||||
query::ExpressionEvaluator evaluator(
|
|
||||||
&frame, context.symbol_table_, context.evaluation_context_,
|
|
||||||
&context.db_accessor_, query::GraphView::OLD);
|
|
||||||
while (state.KeepRunning()) {
|
|
||||||
function->Accept(evaluator);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void BenchmarkCoalesceCallWithStrings(benchmark::State &state) {
|
|
||||||
int64_t num_args = state.range(0);
|
|
||||||
query::AstStorage ast_storage;
|
|
||||||
std::vector<query::Expression *> arguments;
|
|
||||||
arguments.reserve(num_args);
|
|
||||||
for (int64_t i = 0; i < num_args; ++i) {
|
|
||||||
std::string val = "some_string " + std::to_string(i);
|
|
||||||
arguments.emplace_back(ast_storage.Create<query::PrimitiveLiteral>(val));
|
|
||||||
}
|
|
||||||
auto *function = ast_storage.Create<query::Function>("COALESCE", arguments);
|
|
||||||
query::Frame frame(0);
|
|
||||||
database::GraphDbAccessor *dba = nullptr;
|
|
||||||
query::Context context(*dba);
|
|
||||||
query::ExpressionEvaluator evaluator(
|
|
||||||
&frame, context.symbol_table_, context.evaluation_context_,
|
|
||||||
&context.db_accessor_, query::GraphView::OLD);
|
|
||||||
while (state.KeepRunning()) {
|
|
||||||
function->Accept(evaluator);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// We are interested in benchmarking the usual amount of arguments
|
|
||||||
BENCHMARK(BenchmarkCoalesceCallWithNulls)
|
|
||||||
->RangeMultiplier(2)
|
|
||||||
->Range(1, 256)
|
|
||||||
->ThreadRange(1, 16);
|
|
||||||
|
|
||||||
BENCHMARK(BenchmarkCoalesceCallWithStrings)
|
|
||||||
->RangeMultiplier(2)
|
|
||||||
->Range(1, 256)
|
|
||||||
->ThreadRange(1, 16);
|
|
||||||
|
|
||||||
BENCHMARK_MAIN();
|
|
Loading…
Reference in New Issue
Block a user