You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Delete tests/shared_components_tests.cpp, erase legacy code from tests/primitives_scan_bench.cpp, option to run benchmarks from build/bootstrap_mcs.sh
This commit is contained in:
@ -27,8 +27,10 @@ optparse.define short=s long=skip-deps desc="Skip install dependences" variable=
|
||||
optparse.define short=C long=force-cmake-reconfig desc="Force cmake reconfigure" variable=FORCE_CMAKE_CONFIG default=false value=true
|
||||
optparse.define short=S long=skip-columnstore-submodules desc="Skip columnstore submodules initialization" variable=SKIP_SUBMODULES default=false value=true
|
||||
optparse.define short=u long=skip-unit-tests desc="Skip UnitTests" variable=SKIP_UNIT_TESTS default=false value=true
|
||||
optparse.define short=B long=run-microbench="Compile and run microbenchmarks " variable=RUN_BENCHMARKS default=false value=true
|
||||
optparse.define short=b long=branch desc="Choouse git branch ('none' for menu)" variable=BRANCH
|
||||
|
||||
|
||||
source $( optparse.build )
|
||||
|
||||
if [[ ! " ${BUILD_TYPE_OPTIONS[*]} " =~ " ${MCS_BUILD_TYPE} " ]]; then
|
||||
@ -77,7 +79,7 @@ install_deps()
|
||||
libncurses5-dev libaio-dev libsystemd-dev libpcre2-dev \
|
||||
libperl-dev libssl-dev libxml2-dev libkrb5-dev flex libpam-dev git \
|
||||
libsnappy-dev libcurl4-openssl-dev libgtest-dev libcppunit-dev googletest libsnappy-dev libjemalloc-dev \
|
||||
liblz-dev liblzo2-dev liblzma-dev liblz4-dev libbz2-dev
|
||||
liblz-dev liblzo2-dev liblzma-dev liblz4-dev libbz2-dev libbenchmark-dev
|
||||
|
||||
elif [[ $OS = 'CentOS' || $OS = 'Rocky' ]]; then
|
||||
yum -y install epel-release \
|
||||
@ -162,12 +164,31 @@ build()
|
||||
|
||||
if [[ $SKIP_UNIT_TESTS = true ]] ; then
|
||||
warn "Unittests are not build"
|
||||
MDB_CMAKE_FLAGS="${MDB_CMAKE_FLAGS} -DWITH_UNITTESTS=NO -DWITH_BRM_UT=NO"
|
||||
|
||||
else
|
||||
MDB_CMAKE_FLAGS="${MDB_CMAKE_FLAGS} -DWITH_UNITTESTS=YES -DWITH_BRM_UT=YES"
|
||||
MDB_CMAKE_FLAGS="${MDB_CMAKE_FLAGS} -DWITH_UNITTESTS=YES"
|
||||
message "Buiding with unittests"
|
||||
fi
|
||||
|
||||
if [[ $RUN_BENCHMARKS = true ]] ; then
|
||||
if [[ $MCS_BUILD_TYPE = 'Debug' ]] ; then
|
||||
error "Benchmarks will not be build in run in Debug build Mode"
|
||||
MDB_CMAKE_FLAGS="${MDB_CMAKE_FLAGS} -DWITH_MICROBENCHMARKS=NO"
|
||||
$RUN_BENCHMARKS = false
|
||||
elif [[ $OS != 'Ubuntu' && $OS != 'Debian' ]] ; then
|
||||
error "Benchmarks are now avaliable only at Ubuntu or Debian"
|
||||
MAKE_FLAGS="${MDB_CMAKE_FLAGS} -DWITH_MICROBENCHMARKS=NO"
|
||||
$RUN_BENCHMARKS = false
|
||||
else
|
||||
message "Compile with microbenchmarks"
|
||||
MDB_CMAKE_FLAGS="${MDB_CMAKE_FLAGS} -DWITH_MICROBENCHMARKS=YES"
|
||||
fi
|
||||
else
|
||||
MDB_CMAKE_FLAGS="${MDB_CMAKE_FLAGS} -DWITH_MICROBENCHMARKS=NO"
|
||||
info "Buiding without microbenchmarks"
|
||||
fi
|
||||
|
||||
|
||||
cd $MDB_SOURCE_PATH
|
||||
|
||||
if [[ $SKIP_SUBMODULES = true ]] ; then
|
||||
@ -234,6 +255,18 @@ run_unit_tests()
|
||||
fi
|
||||
}
|
||||
|
||||
run_microbenchmarks_tests()
|
||||
{
|
||||
if [[ $RUN_BENCHMARKS = false ]] ; then
|
||||
warn "Skipping microbenchmarks"
|
||||
else
|
||||
message "Runnning microbenchmarks"
|
||||
cd $MDB_SOURCE_PATH
|
||||
ctest . -V -R columnstore_microbenchmarks: -j $(nproc)
|
||||
cd -
|
||||
fi
|
||||
}
|
||||
|
||||
install()
|
||||
{
|
||||
message "Installing MariaDB"
|
||||
@ -313,6 +346,7 @@ stop_service
|
||||
clean_old_installation
|
||||
build
|
||||
run_unit_tests
|
||||
run_microbenchmarks_tests
|
||||
install
|
||||
start_service
|
||||
message "$color_green FINISHED $color_normal"
|
||||
|
@ -64,30 +64,22 @@ if (WITH_UNITTESTS)
|
||||
target_link_libraries(fair_threadpool_test ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} ${GTEST_LIBRARIES} processor dbbc)
|
||||
gtest_add_tests(TARGET fair_threadpool_test TEST_PREFIX columnstore:)
|
||||
|
||||
# CPPUNIT TESTS
|
||||
add_executable(we_shared_components_tests shared_components_tests.cpp)
|
||||
add_dependencies(we_shared_components_tests loggingcpp)
|
||||
target_link_libraries(we_shared_components_tests ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} cppunit)
|
||||
#Fix Test and uncomment
|
||||
#add_test(NAME columnstore:we_shared_components_tests, COMMAND we_shared_components_tests)
|
||||
|
||||
add_executable(comparators_tests comparators-tests.cpp)
|
||||
target_link_libraries(comparators_tests ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} ${CPPUNIT_LIBRARIES} cppunit)
|
||||
add_test(NAME columnstore:comparators_tests, COMMAND comparators_tests)
|
||||
add_test(NAME columnstore:comparators_tests COMMAND comparators_tests)
|
||||
|
||||
# standalone EM routines test
|
||||
# add_executable(brm_em_standalone brm-em-standalone.cpp)
|
||||
# target_link_libraries(brm_em_standalone ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} ${CPPUNIT_LIBRARIES} cppunit)
|
||||
# install(TARGETS brm_em_standalone DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
|
||||
add_executable(brm_em_standalone brm-em-standalone.cpp)
|
||||
target_link_libraries(brm_em_standalone ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} ${CPPUNIT_LIBRARIES} cppunit)
|
||||
add_test(NAME columnstore:brm_em_standalone COMMAND brm_em_standalone)
|
||||
set_tests_properties(columnstore:brm_em_standalone PROPERTIES DISABLED True)
|
||||
endif()
|
||||
|
||||
# Saving this as the example of the microbench
|
||||
#if (WITH_MICROBENCHMARKS AND (NOT CMAKE_BUILD_TYPE STREQUAL "debug"))
|
||||
# find_package(benchmark REQUIRED)
|
||||
# add_executable(primitives_scan_bench primitives_scan_bench.cpp)
|
||||
# target_include_directories(primitives_scan_bench PUBLIC ${ENGINE_COMMON_INCLUDES} ${ENGINE_BLOCKCACHE_INCLUDE} ${ENGINE_PRIMPROC_INCLUDE} )
|
||||
# target_link_libraries(primitives_scan_bench ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} ${GTEST_LIBRARIES} processor dbbc benchmark::benchmark)
|
||||
# install(TARGETS primitives_scan_bench DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
#endif()
|
||||
if (WITH_MICROBENCHMARKS AND (NOT CMAKE_BUILD_TYPE STREQUAL "Debug"))
|
||||
find_package(benchmark REQUIRED)
|
||||
add_executable(primitives_scan_bench primitives_scan_bench.cpp)
|
||||
target_include_directories(primitives_scan_bench PUBLIC ${ENGINE_COMMON_INCLUDES} ${ENGINE_BLOCKCACHE_INCLUDE} ${ENGINE_PRIMPROC_INCLUDE} )
|
||||
target_link_libraries(primitives_scan_bench ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} ${GTEST_LIBRARIES} processor dbbc benchmark::benchmark)
|
||||
add_test(NAME columnstore_microbenchmarks:primitives_scan_bench, COMMAND primitives_scan_bench)
|
||||
endif()
|
||||
|
||||
|
@ -1150,7 +1150,7 @@ static void* EMRunner(void* arg)
|
||||
if (listSize == 0)
|
||||
break;
|
||||
|
||||
struct EMEntries* tmp, *prev;
|
||||
struct EMEntries* tmp = nullptr, *prev = nullptr;
|
||||
int fileRand = rand_r(&randstate) % listSize;
|
||||
int i, oid;
|
||||
|
||||
|
@ -100,10 +100,6 @@ class FilterBenchFixture : public benchmark::Fixture
|
||||
in->NVALS = 0;
|
||||
pp.setBlockPtr((int*)readBlockFromLiteralArray(dataName, block));
|
||||
}
|
||||
void runFilterBenchLegacy()
|
||||
{
|
||||
pp.p_Col(in, out, 4 * BLOCK_SIZE, &written);
|
||||
}
|
||||
|
||||
template <int W>
|
||||
void runFilterBenchTemplated()
|
||||
@ -124,36 +120,6 @@ class FilterBenchFixture : public benchmark::Fixture
|
||||
}
|
||||
};
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan1ByteLegacyCode)(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
constexpr const uint8_t W = 1;
|
||||
state.PauseTiming();
|
||||
inTestRunSetUp("col1block.cdf", W, SystemCatalog::CHAR, OT_DATAVALUE, args);
|
||||
state.ResumeTiming();
|
||||
runFilterBenchLegacy();
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_REGISTER_F(FilterBenchFixture, BM_ColumnScan1ByteLegacyCode);
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan1Byte1FilterLegacyCode)(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
state.PauseTiming();
|
||||
constexpr const uint8_t W = 1;
|
||||
setUp1EqFilter<W>();
|
||||
inTestRunSetUp("col1block.cdf", W, SystemCatalog::CHAR, OT_DATAVALUE, args);
|
||||
state.ResumeTiming();
|
||||
|
||||
runFilterBenchLegacy();
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_REGISTER_F(FilterBenchFixture, BM_ColumnScan1Byte1FilterLegacyCode);
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan1ByteTemplatedCode)(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state)
|
||||
@ -212,33 +178,6 @@ BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan1Byte1FilterVectorizedCode)(
|
||||
|
||||
BENCHMARK_REGISTER_F(FilterBenchFixture, BM_ColumnScan1Byte1FilterVectorizedCode);
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan2ByteLegacyCode)(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
constexpr const uint8_t W = 2;
|
||||
state.PauseTiming();
|
||||
inTestRunSetUp("col2block.cdf", W, SystemCatalog::INT, OT_DATAVALUE, args);
|
||||
state.ResumeTiming();
|
||||
runFilterBenchLegacy();
|
||||
}
|
||||
}
|
||||
BENCHMARK_REGISTER_F(FilterBenchFixture, BM_ColumnScan2ByteLegacyCode);
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan2Byte1FilterLegacyCode)(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
state.PauseTiming();
|
||||
constexpr const uint8_t W = 2;
|
||||
setUp1EqFilter<W>();
|
||||
inTestRunSetUp("col2block.cdf", W, SystemCatalog::INT, OT_DATAVALUE, args);
|
||||
state.ResumeTiming();
|
||||
runFilterBenchLegacy();
|
||||
}
|
||||
}
|
||||
BENCHMARK_REGISTER_F(FilterBenchFixture, BM_ColumnScan2Byte1FilterLegacyCode);
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan2ByteTemplatedCode)(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state)
|
||||
@ -283,34 +222,6 @@ BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan2Byte1FilterVectorizedCode)(
|
||||
|
||||
BENCHMARK_REGISTER_F(FilterBenchFixture, BM_ColumnScan2Byte1FilterVectorizedCode);
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan4ByteLegacyCode)(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
constexpr const uint8_t W = 4;
|
||||
state.PauseTiming();
|
||||
inTestRunSetUp("col4block.cdf", W, SystemCatalog::INT, OT_DATAVALUE, args);
|
||||
state.ResumeTiming();
|
||||
runFilterBenchLegacy();
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_REGISTER_F(FilterBenchFixture, BM_ColumnScan4ByteLegacyCode);
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan4Byte1FilterLegacyCode)(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
constexpr const uint8_t W = 4;
|
||||
state.PauseTiming();
|
||||
setUp1EqFilter<W>();
|
||||
inTestRunSetUp("col4block.cdf", W, SystemCatalog::INT, OT_DATAVALUE, args);
|
||||
state.ResumeTiming();
|
||||
runFilterBenchLegacy();
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_REGISTER_F(FilterBenchFixture, BM_ColumnScan4Byte1FilterLegacyCode);
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan4ByteTemplatedCode)(benchmark::State& state)
|
||||
{
|
||||
@ -341,33 +252,6 @@ BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan4ByteVectorizedCode)(benchma
|
||||
|
||||
BENCHMARK_REGISTER_F(FilterBenchFixture, BM_ColumnScan4ByteVectorizedCode);
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan8ByteLegacyCode)(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
constexpr const uint8_t W = 8;
|
||||
state.PauseTiming();
|
||||
inTestRunSetUp("col8block.cdf", W, SystemCatalog::INT, OT_DATAVALUE, args);
|
||||
state.ResumeTiming();
|
||||
runFilterBenchLegacy();
|
||||
}
|
||||
}
|
||||
BENCHMARK_REGISTER_F(FilterBenchFixture, BM_ColumnScan8ByteLegacyCode);
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan8Byte1FilterLegacyCode)(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state)
|
||||
{
|
||||
state.PauseTiming();
|
||||
constexpr const uint8_t W = 8;
|
||||
setUp1EqFilter<W>();
|
||||
inTestRunSetUp("col8block.cdf", W, SystemCatalog::INT, OT_DATAVALUE, args);
|
||||
state.ResumeTiming();
|
||||
runFilterBenchLegacy();
|
||||
}
|
||||
}
|
||||
BENCHMARK_REGISTER_F(FilterBenchFixture, BM_ColumnScan8Byte1FilterLegacyCode);
|
||||
|
||||
BENCHMARK_DEFINE_F(FilterBenchFixture, BM_ColumnScan8ByteTemplatedCode)(benchmark::State& state)
|
||||
{
|
||||
for (auto _ : state)
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user