Skip to content

Commit

Permalink
remove old and commit neww
Browse files Browse the repository at this point in the history
  • Loading branch information
zclllyybb committed Nov 19, 2024
1 parent 2bc1964 commit 5fde914
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 337 deletions.
4 changes: 2 additions & 2 deletions be/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ if (OS_MACOSX)
)
endif()

if (MAKE_TEST OR BUILD_BENCHMARK)
if (BUILD_BENCHMARK)
set(COMMON_THIRDPARTY
${COMMON_THIRDPARTY}
benchmark
Expand Down Expand Up @@ -818,5 +818,5 @@ if (BUILD_BENCHMARK)
add_executable(benchmark_test ${BASE_DIR}/benchmark/benchmark_main.cpp)
target_link_libraries(benchmark_test ${DORIS_LINK_LIBS})
message(STATUS "Add benchmark to build")
install(TARGETS benchmark_test DESTINATION ${OUTPUT_DIR})
install(TARGETS benchmark_test DESTINATION ${OUTPUT_DIR}/lib)
endif()
7 changes: 5 additions & 2 deletions be/benchmark/benchmark_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,27 @@
#include "vec/data_types/data_type.h"
#include "vec/data_types/data_type_string.h"

namespace doris::vectorized {
namespace doris::vectorized { // change if need

static void Example1(benchmark::State& state) {
// init. dont time it.
state.PauseTiming();
Block block;
DataTypePtr str_type = std::make_shared<DataTypeString>();
std::vector<std::string> vals {100, "content"};
state.ResumeTiming();

// do test
for (auto _ : state) {
auto str_col = ColumnString::create();
for (auto& v : vals) {
str_col->insert_data(v.data(), v.size());
}
block.insert({std::move(str_col), str_type, "col"});
benchmark::DoNotOptimize(block);
benchmark::DoNotOptimize(block); // mark the watched target
}
}
// could BENCHMARK many functions to compare them together.
BENCHMARK(Example1);

} // namespace doris::vectorized
Expand Down
11 changes: 0 additions & 11 deletions be/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,3 @@ if (OS_MACOSX AND ARCH_ARM)
COMMAND ${LLVM_STRIP} --strip-all $<TARGET_FILE:doris_be_test>
)
endif()

if (BUILD_BENCHMARK_TOOL AND BUILD_BENCHMARK_TOOL STREQUAL "ON")
add_executable(benchmark_tool
tools/benchmark_tool.cpp
testutil/test_util.cpp
olap/tablet_schema_helper.cpp
)

target_link_libraries(benchmark_tool ${TEST_LINK_LIBS})
set_target_properties(benchmark_tool PROPERTIES COMPILE_FLAGS "-fno-access-control")
endif()
320 changes: 0 additions & 320 deletions be/test/tools/benchmark_tool.cpp

This file was deleted.

Loading

0 comments on commit 5fde914

Please sign in to comment.