Skip to content

Commit

Permalink
Adding more mature build system
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Vladimirov committed Mar 1, 2024
1 parent c62e137 commit 975fd72
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.11)
project("benchmarks")

enable_testing()
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/CSVS)
set(CSVS ${CMAKE_BINARY_DIR}/CSVS)
file(MAKE_DIRECTORY ${CSVS})

find_package(cppbenchmark REQUIRED)

Expand Down
3 changes: 2 additions & 1 deletion coro-fibs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target_link_libraries(${TNAME} cppbenchmark::cppbenchmark)

add_test(
NAME TEST_${TNAME}
COMMAND ${TNAME} -q -o csv > ${CMAKE_BINARY_DIR}/CSVS/${TNAME}.csv)
COMMAND sh -c "./${TNAME} -q -o csv > ${CSVS}/${TNAME}.csv"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(${TEST_TARGET} PROPERTIES DEPENDS ${TNAME})

4 changes: 2 additions & 2 deletions excret/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ target_link_libraries(${TNAME} cppbenchmark::cppbenchmark)

add_test(
NAME TEST_${TNAME}
COMMAND ${TNAME} -q -o csv > ${CMAKE_BINARY_DIR}/CSVS/${TNAME}.csv)
COMMAND sh -c "./${TNAME} -q -o csv > ${CSVS}/${TNAME}.csv"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(${TEST_TARGET} PROPERTIES DEPENDS ${TNAME})

3 changes: 2 additions & 1 deletion inline/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target_link_libraries(${TNAME} cppbenchmark::cppbenchmark)

add_test(
NAME TEST_${TNAME}
COMMAND ${TNAME} -q -o csv > ${CMAKE_BINARY_DIR}/CSVS/${TNAME}.csv)
COMMAND sh -c "./${TNAME} -q -o csv > ${CSVS}/${TNAME}.csv"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(${TEST_TARGET} PROPERTIES DEPENDS ${TNAME})

7 changes: 5 additions & 2 deletions noexcept-qsort/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ target_link_libraries(${TNAME} cppbenchmark::cppbenchmark)

add_test(
NAME TEST_${TNAME}
COMMAND ${TNAME} -q -o csv > ${CMAKE_BINARY_DIR}/CSVS/${TNAME}.csv)
COMMAND sh -c "./${TNAME} -q -o csv > ${CSVS}/${TNAME}.csv"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(${TEST_TARGET} PROPERTIES DEPENDS ${TNAME})

SET(TNAME exc_partition)
Expand All @@ -17,6 +18,8 @@ target_link_libraries(${TNAME} cppbenchmark::cppbenchmark)

add_test(
NAME TEST_${TNAME}
COMMAND ${TNAME} -q -o csv > ${CMAKE_BINARY_DIR}/CSVS/${TNAME}.csv)
COMMAND sh -c "./${TNAME} -q -o csv > ${CSVS}/${TNAME}.csv"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(${TEST_TARGET} PROPERTIES DEPENDS ${TNAME})


4 changes: 3 additions & 1 deletion ranges-filter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ target_link_libraries(${TNAME} cppbenchmark::cppbenchmark)

add_test(
NAME TEST_${TNAME}
COMMAND ${TNAME} -q -o csv > ${CMAKE_BINARY_DIR}/CSVS/${TNAME}.csv)
COMMAND sh -c "./${TNAME} -q -o csv > ${CSVS}/${TNAME}.csv"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(${TEST_TARGET} PROPERTIES DEPENDS ${TNAME})


4 changes: 3 additions & 1 deletion ranges-projector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ target_link_libraries(${TNAME} cppbenchmark::cppbenchmark)

add_test(
NAME TEST_${TNAME}
COMMAND ${TNAME} -q -o csv > ${CMAKE_BINARY_DIR}/CSVS/${TNAME}.csv)
COMMAND sh -c "./${TNAME} -q -o csv > ${CSVS}/${TNAME}.csv"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(${TEST_TARGET} PROPERTIES DEPENDS ${TNAME})


24 changes: 24 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Benchmarks for Yadro C++ meetup talk

This repo consists of Yadro C++ talk benchmarks.

## Building and running

We are using CppBenchmark via Conan repo. To guarantee clean conan setup please use venv. See full build sequence below.

```
git clone https://github.com/tilir/benchmarks.git
cd benchmarks
python3 -m venv .venv
source .venv/bin/activate
pip3 install conan
conan install conanfile.txt --build=missing
cmake -S . -B build/Release --toolchain build/Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build build/Release
env CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/Release --target test --parallel 1
```

This will take some time, be patient. Benchmarking results will be created in the build/Release/CSVS folder.

You are welcome to create MR in results folder with your architecture and name it will help my talk!

4 changes: 3 additions & 1 deletion virtual-inherit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ target_link_libraries(${TNAME} cppbenchmark::cppbenchmark)

add_test(
NAME TEST_${TNAME}
COMMAND ${TNAME} -q -o csv > ${CMAKE_BINARY_DIR}/CSVS/${TNAME}.csv)
COMMAND sh -c "./${TNAME} -q -o csv > ${CSVS}/${TNAME}.csv"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(${TEST_TARGET} PROPERTIES DEPENDS ${TNAME})


4 changes: 3 additions & 1 deletion virtual-inline/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ target_link_libraries(${TNAME} cppbenchmark::cppbenchmark)

add_test(
NAME TEST_${TNAME}
COMMAND ${TNAME} -q -o csv > ${CMAKE_BINARY_DIR}/CSVS/${TNAME}.csv)
COMMAND sh -c "./${TNAME} -q -o csv > ${CSVS}/${TNAME}.csv"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(${TEST_TARGET} PROPERTIES DEPENDS ${TNAME})


7 changes: 5 additions & 2 deletions virtual-overhead/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ target_link_libraries(${TNAME} cppbenchmark::cppbenchmark)

add_test(
NAME TEST_${TNAME}
COMMAND ${TNAME} -q -o csv > ${CMAKE_BINARY_DIR}/CSVS/${TNAME}.csv)
COMMAND sh -c "./${TNAME} -q -o csv > ${CSVS}/${TNAME}.csv"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(${TEST_TARGET} PROPERTIES DEPENDS ${TNAME})

SET(TNAME virtual-shuffle)
Expand All @@ -17,6 +18,8 @@ target_link_libraries(${TNAME} cppbenchmark::cppbenchmark)

add_test(
NAME TEST_${TNAME}
COMMAND ${TNAME} -q -o csv > ${CMAKE_BINARY_DIR}/CSVS/${TNAME}.csv)
COMMAND sh -c "./${TNAME} -q -o csv > ${CSVS}/${TNAME}.csv"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties(${TEST_TARGET} PROPERTIES DEPENDS ${TNAME})


0 comments on commit 975fd72

Please sign in to comment.