Skip to content

Commit 2b7d240

Browse files
authored
New benchmark framework (#803)
* updating the benchmarks * update * lint
1 parent fc6fa2e commit 2b7d240

20 files changed

Lines changed: 4479 additions & 2110 deletions

benchmarks/CMakeLists.txt

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
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 lemire/counters (https://github.com/lemire/counters) for hardware
3+
# performance counters (cycles, instructions, branches, branch misses,
4+
# cache misses).
5+
if(ROARING_USE_CPM AND NOT WIN32)
6+
CPMAddPackage(
7+
NAME counters
8+
GIT_REPOSITORY https://github.com/lemire/counters.git
9+
GIT_TAG v4.1.0
10+
OPTIONS
11+
"COUNTERS_INSTALL OFF"
12+
"COUNTERS_BUILD_TESTS OFF"
13+
)
214

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)
15+
# Copy the real-bitmap datasets into the build directory so the unified
16+
# benchmark auto-loads them by default. file(COPY) is configure-time and
17+
# skip-if-unchanged (preserves timestamps), so reconfigure is cheap.
18+
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/realdata"
19+
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
20+
set(BENCHMARK_DATA_DIR "${CMAKE_CURRENT_BINARY_DIR}/realdata")
21+
22+
add_executable(benchmark benchmark.cpp)
23+
target_link_libraries(benchmark PRIVATE roaring counters::counters)
24+
target_compile_definitions(benchmark PRIVATE
25+
BENCHMARK_DATA_DIR="${BENCHMARK_DATA_DIR}")
1726
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)

benchmarks/add_benchmark.c

Lines changed: 0 additions & 195 deletions
This file was deleted.

benchmarks/adversarialunions_benchmark.c

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)