Skip to content

Commit 017c8d1

Browse files
committed
Finished Benchmarks
* Added matching benchmark * Added utils functions for test/performance * Added Boost benchmark
1 parent 739366f commit 017c8d1

22 files changed

Lines changed: 932 additions & 815 deletions

test/README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,24 @@ Measures and outputs execution time of predefined tests.
3131
The following benchmarks can be executed from the sb-graph/build/ directory
3232
with the following commands:
3333
- `make run-benchmark`: benchmark for some implementations of Sets and PWMaps.
34+
- `make run-match`: benchmark for the maximum matching algorithm applied to
35+
TestRL1.test, TestRL2.test and TestRL3.test.
3436
- `make run-scc`: benchmark for the SCC algorithm applied to TestRL1.test,
3537
TestRL2.test and TestRL3.test.
3638

3739
In the ./test/build/bin there are also some helpful binaries:
3840
- boost-perf: used to evaluate the performance of traditional graphs
3941
algorithms.
42+
- custom-match-benchmark: benchmark for the maximum matching algorithm applied
43+
to a custom .test file. Environmental variables TEST_FILE, SET_IMPL and
44+
PW_IMPL are support. So, for example,
45+
`TEST_FILE="../../TestRL1.test" SET_IMPL="2" ./custom-match-benchmark` runs
46+
the benchmark for TestRL1.test with the ordered unidimensional dense set
47+
implementation.
4048
- custom-scc-benchmark: benchmark for the SCC algorithm applied to a custom
4149
.test file. Environmental variables TEST_FILE, SET_IMPL and PW_IMPL are
42-
supported. So, for example,
43-
`TEST_FILE="../../TestRL1.test" SET_IMP="2" ./custom-scc-benchmark` runs the
44-
benchmark for TestRL1.test with the ordered unidimensional dense set
45-
implementation.
46-
47-
There are also some scripts in some subfolders, that will be deleted in the
48-
near future.
50+
supported.
51+
- custom-boost-benchmark: benchmark for the C++ Boost Graph Library
52+
traditional scalar algorithms. This benchmark is introduced to compare
53+
the SBG approach with existing techniques. Environmental variable TEST_FILE
54+
is supported.

test/TestRL2.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ equation
2121
end TestRL2;
2222
*/
2323

24-
N = 1000000;
24+
N = 100000;
2525

2626
F1 = N;
2727
F2 = N-1+F1;

test/TestRL3.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ equation
2222
end TestRL3;
2323
*/
2424

25-
N = 1000000;
25+
N = 100000;
2626

2727
F1 = N;
2828
F2 = N-1+F1;

test/performance/CMakeLists.txt

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SBG Benchmark
1+
# SBG Benchmark for different Set and PWMap implementations
22
add_executable(sbg-benchmark benchmark_main.cpp)
33

44
target_sources(sbg-benchmark
@@ -24,16 +24,6 @@ target_link_libraries(sbg-benchmark
2424
sbg-dev
2525
sbg-eval-lib)
2626

27-
# SCC Benchmark
28-
add_executable(scc-benchmark benchmark_main.cpp scc/scc_bm.cpp)
29-
target_link_libraries(scc-benchmark PUBLIC benchmark::benchmark PRIVATE sbg-dev sbg-eval-lib)
30-
set_target_properties(scc-benchmark PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_DIR})
31-
add_custom_target(run-scc
32-
COMMAND cd ${BIN_DIR} && ./scc-benchmark
33-
)
34-
add_dependencies(run-scc scc-benchmark)
35-
36-
# SCC Benchmark
37-
add_executable(custom-scc-benchmark benchmark_main.cpp scc/custom_scc_bm.cpp)
38-
target_link_libraries(custom-scc-benchmark PUBLIC benchmark::benchmark PRIVATE sbg-dev sbg-eval-lib)
39-
set_target_properties(custom-scc-benchmark PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_DIR})
27+
add_subdirectory(boost)
28+
add_subdirectory(matching)
29+
add_subdirectory(scc)
Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,17 @@
1-
# Add executable
2-
add_executable(
3-
boost-perf
4-
)
5-
6-
target_sources(
7-
boost-perf
8-
PRIVATE
9-
boost_exec.cpp
10-
main.cpp
11-
ordinary_graph.cpp
12-
ordinary_graph_builder.cpp
13-
)
14-
15-
target_compile_options(boost-perf PRIVATE "-Wall")
16-
17-
# Link the library
18-
target_link_libraries(boost-perf
19-
PRIVATE
20-
sbg-dev
21-
sbgraph
22-
sbg-eval-lib
23-
${GOOGLE_TEST_LIB}
24-
${GOOGLE_MOCK_LIB}
25-
pthread
26-
)
27-
28-
target_include_directories(boost-perf PRIVATE ${GOOGLE_TEST_INCLUDE} ${PROJECT_SOURCE_DIR})
29-
30-
target_link_directories(boost-perf PRIVATE ${GOOGLE_TEST_INSTALL}/lib)
31-
32-
# Set output directory for executable
33-
set_target_properties(boost-perf PROPERTIES
34-
RUNTIME_OUTPUT_DIRECTORY
35-
${BIN_DIR}
36-
)
1+
# Custom Boost Benchmark
2+
add_executable(custom-boost-benchmark)
3+
target_sources(custom-boost-benchmark
4+
PRIVATE
5+
../benchmark_main.cpp
6+
custom_boost_bm.cpp
7+
ordinary_graph.cpp
8+
ordinary_graph_builder.cpp
9+
../utils.cpp)
10+
target_link_libraries(custom-boost-benchmark
11+
PUBLIC
12+
benchmark::benchmark
13+
PRIVATE
14+
sbg-dev
15+
sbg-eval-lib)
16+
set_target_properties(custom-boost-benchmark
17+
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_DIR})

test/performance/boost/boost_exec.cpp

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

test/performance/boost/boost_exec.hpp

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

0 commit comments

Comments
 (0)