Commit dae1195f authored by Philipp Götze's avatar Philipp Götze

Adapted benchmarks

parent 8da32c15
......@@ -21,7 +21,7 @@ set(PMEM_MNT_PATH "/mnt/pmem/test")
option(ENABLE_LOG "enables log output for e.g. debugging" OFF)
option(BUILD_TEST_CASES "build tests for PTable functionality" ON )
option(BUILD_GOOGLE_BENCH "build google benchmark" OFF)
option(BUILD_BENCHMARKS "build benchmarks for Ptable" ON )
option(BUILD_BENCHMARKS "build benchmarks for Ptable" OFF)
################################################################################
# End of customization section #
......
......@@ -37,7 +37,7 @@ namespace ptable {
const std::string LAYOUT = "PTable";
auto const TARGET_INDEX_NODE_SIZE = 1024; // 1KB
auto const TARGET_INDEX_NODE_SIZE = 1 * 1024; // 1KB
/** Abort reason codes: */
const auto NOT_ENOUGH_SPACE = 1;
......@@ -1136,6 +1136,7 @@ class PTable<KeyType, std::tuple<Types...>> {
const auto &b = ptp.getNode()->block.get_ro();
auto inRange = true;
/*
auto isInRange = [&](auto element, std::size_t idx) {
if (!inRange) return; // previous element already not in range
if (predicates.find(idx) == predicates.end()) return; // check if column is used in predicates
......@@ -1149,10 +1150,10 @@ class PTable<KeyType, std::tuple<Types...>> {
};
forEachTypeInTuple<decltype(isInRange), Types...>(isInRange);
return inRange;
*/
/*
for (const auto &p: predicates) {
auto offset = ptp.getOffsetAt(p.first);
const auto offset = ptp.getOffsetAt(p.first);
switch (tInfo.columnInfo(p.first).getType()) {
case ColumnType::IntType: {
......@@ -1180,7 +1181,6 @@ class PTable<KeyType, std::tuple<Types...>> {
}
}
return true;
*/
}
const bool findInsertNodeOrSplit(DataNodePtr &node, const Tuple &tp) const {
......
......@@ -46,8 +46,8 @@ struct root {
};
const std::string path = ptable::gPmemPath + "benchdb.db";
const auto NUM_TUPLES = 1000 * 1000;
const auto POOL_SIZE = 1024 * 1024 * 1024 * 2ull; // 2GB
const auto NUM_TUPLES = 1000 * 100;
const auto POOL_SIZE = 1024 * 1024 * 256; // * 4ull; // 1GB
const auto ALIGNMENT = hibit_pos(NUM_TUPLES) + 1;
VectorVector pv;
......@@ -59,20 +59,23 @@ const VectorVector KEY_RANGES = {
Vector{NUM_TUPLES / 2 - NUM_TUPLES / 200, NUM_TUPLES / 2 + NUM_TUPLES / 200}, // 1,0%
Vector{NUM_TUPLES / 2 - NUM_TUPLES / 40, NUM_TUPLES / 2 + NUM_TUPLES / 40}, // 5,0%
Vector{NUM_TUPLES / 2 - NUM_TUPLES / 20, NUM_TUPLES / 2 + NUM_TUPLES / 20}, // 10,0%
Vector{NUM_TUPLES / 2 - NUM_TUPLES / 10, NUM_TUPLES / 2 + NUM_TUPLES / 10}, // 20,0%
Vector{0, NUM_TUPLES-1} //100,0%
};
const VectorVector NON_KEY_RANGES = {
Vector{NUM_TUPLES / 2 - NUM_TUPLES / 1000, NUM_TUPLES / 2 + NUM_TUPLES / 1000,
NUM_TUPLES / 2, NUM_TUPLES / 2 + NUM_TUPLES / 500}, // 0,1%
NUM_TUPLES / 2, NUM_TUPLES / 2 + NUM_TUPLES / 500}, // 0,1%
Vector{NUM_TUPLES / 2 - NUM_TUPLES / 200, NUM_TUPLES / 2 + NUM_TUPLES / 200,
NUM_TUPLES / 2, NUM_TUPLES / 2 + NUM_TUPLES / 100}, // 0,5%
NUM_TUPLES / 2, NUM_TUPLES / 2 + NUM_TUPLES / 100}, // 0,5%
Vector{NUM_TUPLES / 2 - NUM_TUPLES / 100, NUM_TUPLES / 2 + NUM_TUPLES / 100,
NUM_TUPLES / 2, NUM_TUPLES / 2 + NUM_TUPLES / 50}, // 1,0%
NUM_TUPLES / 2, NUM_TUPLES / 2 + NUM_TUPLES / 50}, // 1,0%
Vector{NUM_TUPLES / 2 - NUM_TUPLES / 20, NUM_TUPLES / 2 + NUM_TUPLES / 20,
NUM_TUPLES / 2, NUM_TUPLES / 2 + NUM_TUPLES / 10}, // 5,0%
NUM_TUPLES / 2, NUM_TUPLES / 2 + NUM_TUPLES / 10}, // 5,0%
Vector{NUM_TUPLES / 2 - NUM_TUPLES / 10, NUM_TUPLES / 2 + NUM_TUPLES / 10,
NUM_TUPLES / 2, NUM_TUPLES / 2 + NUM_TUPLES / 5}, // 10,0%
NUM_TUPLES / 2, NUM_TUPLES / 2 + NUM_TUPLES / 5}, // 10,0%
Vector{NUM_TUPLES / 2 - NUM_TUPLES / 5, NUM_TUPLES / 2 + NUM_TUPLES / 5,
NUM_TUPLES / 2, NUM_TUPLES / 2 + NUM_TUPLES * 2 / 5 }, // 20,0%
Vector{0, NUM_TUPLES - 1, 0, NUM_TUPLES - 1} //100,0%
};
......
......@@ -31,11 +31,10 @@ static void BM_PointQuery(benchmark::State& state) {
const std::string path = ptable::gPmemPath + "benchdb" + std::to_string(state.range(0)) + ".db";
//std::remove(path.c_str());
if (access(path.c_str(), F_OK) != 0) {
insert(pop, path, state.range(0));
} else {
std::cerr << "WARNING: Table already exists" << std::endl;
//std::cerr << "WARNING: Table already exists" << std::endl;
pop = pool<root>::open(path, LAYOUT);
}
......
......@@ -49,7 +49,7 @@ static void BM_RangeScan(benchmark::State &state) {
static void KeyRangeArguments(benchmark::internal::Benchmark* b) {
for (const auto &arg : KEY_RANGES) b->Args(arg);
}
//BENCHMARK(BM_RangeScan)->Apply(KeyRangeArguments);
BENCHMARK(BM_RangeScan)->Apply(KeyRangeArguments);
static void BM_NonKeyRangeScan(benchmark::State &state) {
......@@ -100,7 +100,7 @@ static void BM_PBPTreeKeyScan(benchmark::State &state) {
pop.close();
//std::remove(path.c_str());
}
//BENCHMARK(BM_PBPTreeKeyScan)->Apply(KeyRangeArguments);
BENCHMARK(BM_PBPTreeKeyScan)->Apply(KeyRangeArguments);
static void BM_PBPTreeScan(benchmark::State &state) {
......@@ -132,7 +132,7 @@ static void BM_PBPTreeScan(benchmark::State &state) {
pop.close();
//std::remove(path.c_str());
}
//BENCHMARK(BM_PBPTreeScan)->Apply(NonKeyRangeArguments);
BENCHMARK(BM_PBPTreeScan)->Apply(NonKeyRangeArguments);
BENCHMARK_MAIN();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment