Skip to content

Commit a6e76d0

Browse files
committed
🚚 Move lookup benchmark to benchmark directory
1 parent f7ea311 commit a6e76d0

File tree

9 files changed

+99
-98
lines changed

9 files changed

+99
-98
lines changed

benchmark/CMakeLists.txt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,2 @@
1-
add_executable(compilation_benchmark EXCLUDE_FROM_ALL big_nexus.cpp)
2-
3-
target_compile_options(
4-
compilation_benchmark
5-
PRIVATE -ftemplate-backtrace-limit=0
6-
$<$<CXX_COMPILER_ID:Clang>:-fconstexpr-steps=2000000>
7-
$<$<CXX_COMPILER_ID:Clang>:-fbracket-depth=512>
8-
$<$<CXX_COMPILER_ID:Clang>:-ferror-limit=8>
9-
$<$<CXX_COMPILER_ID:GNU>:-fmax-errors=8>)
10-
11-
target_link_libraries(compilation_benchmark PRIVATE cib profile-compilation)
12-
target_include_directories(compilation_benchmark
13-
PRIVATE ${CMAKE_SOURCE_DIR}/test/)
1+
add_subdirectory(cib)
2+
add_subdirectory(lookup)

benchmark/cib/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
add_executable(compilation_benchmark EXCLUDE_FROM_ALL big_nexus.cpp)
2+
3+
target_compile_options(
4+
compilation_benchmark
5+
PRIVATE -ftemplate-backtrace-limit=0
6+
$<$<CXX_COMPILER_ID:Clang>:-fconstexpr-steps=2000000>
7+
$<$<CXX_COMPILER_ID:Clang>:-fbracket-depth=512>
8+
$<$<CXX_COMPILER_ID:Clang>:-ferror-limit=8>
9+
$<$<CXX_COMPILER_ID:GNU>:-fmax-errors=8>)
10+
11+
target_link_libraries(compilation_benchmark PRIVATE cib profile-compilation)
12+
target_include_directories(compilation_benchmark
13+
PRIVATE ${CMAKE_SOURCE_DIR}/test/)
File renamed without changes.

benchmark/lookup/CMakeLists.txt

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
add_versioned_package("gh:boost-ext/mph#v1.0.8")
2+
add_versioned_package("gh:serge-sans-paille/frozen#292a811")
3+
4+
# Define the variable values
5+
set(BENCH_ALG_NAMES
6+
std_map
7+
std_unordered_map
8+
frozen_map
9+
frozen_unordered_map
10+
pseudo_pext_direct
11+
pseudo_pext_indirect_1
12+
pseudo_pext_indirect_2
13+
pseudo_pext_indirect_3
14+
pseudo_pext_indirect_4
15+
pseudo_pext_indirect_5
16+
pseudo_pext_indirect_6)
17+
18+
foreach(type IN ITEMS uint16 uint32)
19+
foreach(i RANGE 1 10)
20+
list(APPEND BENCH_DATASETS exp_${i}_${type})
21+
endforeach()
22+
foreach(i RANGE 20 100 10)
23+
list(APPEND BENCH_DATASETS exp_${i}_${type})
24+
endforeach()
25+
foreach(i RANGE 200 1000 100)
26+
list(APPEND BENCH_DATASETS exp_${i}_${type})
27+
endforeach()
28+
endforeach()
29+
30+
set(EXCLUDED_COMBINATIONS
31+
mph_pext_exp_70_uint32
32+
mph_pext_exp_80_uint32
33+
mph_pext_exp_90_uint32
34+
mph_pext_exp_100_uint32
35+
mph_pext_exp_200_uint32
36+
mph_pext_exp_300_uint32
37+
mph_pext_exp_400_uint32
38+
mph_pext_exp_500_uint32
39+
mph_pext_exp_600_uint32
40+
mph_pext_exp_700_uint32
41+
mph_pext_exp_800_uint32
42+
mph_pext_exp_900_uint32
43+
mph_pext_exp_1000_uint32
44+
mph_pext_exp_70_uint16
45+
mph_pext_exp_80_uint16
46+
mph_pext_exp_90_uint16
47+
mph_pext_exp_100_uint16
48+
mph_pext_exp_200_uint16
49+
mph_pext_exp_300_uint16
50+
mph_pext_exp_400_uint16
51+
mph_pext_exp_500_uint16
52+
mph_pext_exp_600_uint16
53+
mph_pext_exp_700_uint16
54+
mph_pext_exp_800_uint16
55+
mph_pext_exp_900_uint16
56+
mph_pext_exp_1000_uint16)
57+
58+
# Generate all possible combinations of the variables
59+
foreach(BENCH_ALG_NAME ${BENCH_ALG_NAMES})
60+
foreach(BENCH_DATASET ${BENCH_DATASETS})
61+
if("${BENCH_ALG_NAME}_${BENCH_DATASET}" IN_LIST EXCLUDED_COMBINATIONS)
62+
continue()
63+
endif()
64+
set(name "${BENCH_ALG_NAME}_${BENCH_DATASET}_bench")
65+
66+
add_benchmark(
67+
${name}
68+
NANO
69+
FILES
70+
pseudo_pext.cpp
71+
SYSTEM_LIBRARIES
72+
cib_lookup
73+
mph
74+
frozen-headers)
75+
target_compile_features(${name} PRIVATE cxx_std_23)
76+
target_compile_options(${name} PRIVATE -fconstexpr-steps=4000000000)
77+
target_compile_definitions(
78+
${name}
79+
PRIVATE ALG_NAME=bench_${BENCH_ALG_NAME}
80+
QALG_NAME="bench_${BENCH_ALG_NAME}"
81+
BENCH_DATASET=${BENCH_DATASET}
82+
QBENCH_DATASET="${BENCH_DATASET}")
83+
endforeach()
84+
endforeach()
File renamed without changes.
File renamed without changes.

test/lookup/CMakeLists.txt

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -6,88 +6,3 @@ add_tests(
66
lookup
77
LIBRARIES
88
cib_lookup)
9-
10-
add_versioned_package("gh:boost-ext/mph#v1.0.8")
11-
add_versioned_package("gh:serge-sans-paille/frozen#292a811")
12-
13-
# Define the variable values
14-
set(BENCH_ALG_NAMES
15-
std_map
16-
std_unordered_map
17-
frozen_map
18-
frozen_unordered_map
19-
pseudo_pext_direct
20-
pseudo_pext_indirect_1
21-
pseudo_pext_indirect_2
22-
pseudo_pext_indirect_3
23-
pseudo_pext_indirect_4
24-
pseudo_pext_indirect_5
25-
pseudo_pext_indirect_6)
26-
27-
foreach(type IN ITEMS uint16 uint32)
28-
foreach(i RANGE 1 10)
29-
list(APPEND BENCH_DATASETS exp_${i}_${type})
30-
endforeach()
31-
foreach(i RANGE 20 100 10)
32-
list(APPEND BENCH_DATASETS exp_${i}_${type})
33-
endforeach()
34-
foreach(i RANGE 200 1000 100)
35-
list(APPEND BENCH_DATASETS exp_${i}_${type})
36-
endforeach()
37-
endforeach()
38-
39-
set(EXCLUDED_COMBINATIONS
40-
mph_pext_exp_70_uint32
41-
mph_pext_exp_80_uint32
42-
mph_pext_exp_90_uint32
43-
mph_pext_exp_100_uint32
44-
mph_pext_exp_200_uint32
45-
mph_pext_exp_300_uint32
46-
mph_pext_exp_400_uint32
47-
mph_pext_exp_500_uint32
48-
mph_pext_exp_600_uint32
49-
mph_pext_exp_700_uint32
50-
mph_pext_exp_800_uint32
51-
mph_pext_exp_900_uint32
52-
mph_pext_exp_1000_uint32
53-
mph_pext_exp_70_uint16
54-
mph_pext_exp_80_uint16
55-
mph_pext_exp_90_uint16
56-
mph_pext_exp_100_uint16
57-
mph_pext_exp_200_uint16
58-
mph_pext_exp_300_uint16
59-
mph_pext_exp_400_uint16
60-
mph_pext_exp_500_uint16
61-
mph_pext_exp_600_uint16
62-
mph_pext_exp_700_uint16
63-
mph_pext_exp_800_uint16
64-
mph_pext_exp_900_uint16
65-
mph_pext_exp_1000_uint16)
66-
67-
# Generate all possible combinations of the variables
68-
foreach(BENCH_ALG_NAME ${BENCH_ALG_NAMES})
69-
foreach(BENCH_DATASET ${BENCH_DATASETS})
70-
if("${BENCH_ALG_NAME}_${BENCH_DATASET}" IN_LIST EXCLUDED_COMBINATIONS)
71-
continue()
72-
endif()
73-
set(name "${BENCH_ALG_NAME}_${BENCH_DATASET}_bench")
74-
75-
add_benchmark(
76-
${name}
77-
NANO
78-
FILES
79-
pseudo_pext.cpp
80-
SYSTEM_LIBRARIES
81-
cib_lookup
82-
mph
83-
frozen-headers)
84-
target_compile_features(${name} PRIVATE cxx_std_23)
85-
target_compile_options(${name} PRIVATE -fconstexpr-steps=4000000000)
86-
target_compile_definitions(
87-
${name}
88-
PRIVATE ALG_NAME=bench_${BENCH_ALG_NAME}
89-
QALG_NAME="bench_${BENCH_ALG_NAME}"
90-
BENCH_DATASET=${BENCH_DATASET}
91-
QBENCH_DATASET="${BENCH_DATASET}")
92-
endforeach()
93-
endforeach()
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)