|
1 | | -set (BENCHMARK_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/realdata/") # does this ever get used? |
| 1 | +# Unified benchmark: one binary, --filter selects a subset of registered cases. |
| 2 | +# Uses sea_counters (https://github.com/lemire/sea_counters) for hardware |
| 3 | +# performance counters (cycles, instructions, branches, branch misses). |
| 4 | +if(ROARING_USE_CPM AND NOT WIN32) |
| 5 | + CPMAddPackage( |
| 6 | + NAME sea_counters |
| 7 | + GIT_REPOSITORY https://github.com/lemire/sea_counters.git |
| 8 | + GIT_TAG v3.0.0 |
| 9 | + OPTIONS |
| 10 | + "SEA_COUNTERS_INSTALL OFF" |
| 11 | + "SEA_SEA_COUNTERS_BUILD_TESTS OFF" |
| 12 | + ) |
2 | 13 |
|
3 | | -add_c_benchmark(create_benchmark) |
4 | | -add_c_benchmark(adversarialunions_benchmark) |
5 | | -# We exclude POSIX tests from Visual Studio default build |
6 | | -if(NOT WIN32) |
7 | | - add_c_benchmark(real_bitmaps_benchmark) |
8 | | - add_c_benchmark(real_bitmaps_contains_benchmark) |
9 | | - add_c_benchmark(iteration_benchmark) |
10 | | - add_c_benchmark(add_benchmark) |
11 | | - target_link_libraries(add_benchmark m) |
12 | | - add_c_benchmark(intersect_range_benchmark) |
13 | | - add_c_benchmark(frozen_benchmark) |
14 | | - add_c_benchmark(containsmulti_benchmark) |
15 | | - add_cpp_benchmark(fastunion_benchmark) |
16 | | - add_cpp_benchmark(sparse_cases_benchmark) |
| 14 | + # Copy the real-bitmap datasets into the build directory so the unified |
| 15 | + # benchmark auto-loads them by default. file(COPY) is configure-time and |
| 16 | + # skip-if-unchanged (preserves timestamps), so reconfigure is cheap. |
| 17 | + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/realdata" |
| 18 | + DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") |
| 19 | + set(BENCHMARK_DATA_DIR "${CMAKE_CURRENT_BINARY_DIR}/realdata") |
| 20 | + |
| 21 | + add_executable(unified_benchmark unified_benchmark.cpp) |
| 22 | + target_link_libraries(unified_benchmark PRIVATE roaring sea_counters::sea_counters) |
| 23 | + target_compile_definitions(unified_benchmark PRIVATE |
| 24 | + BENCHMARK_DATA_DIR="${BENCHMARK_DATA_DIR}") |
17 | 25 | endif() |
18 | | -add_c_benchmark(bitset_container_benchmark) |
19 | | -add_c_benchmark(array_container_benchmark) |
20 | | -add_c_benchmark(run_container_benchmark) |
21 | | -add_c_benchmark(equals_benchmark) |
|
0 commit comments