|
8 | 8 | # Official repository: https://github.com/cppalliance/corosio |
9 | 9 | # |
10 | 10 |
|
11 | | -# Asio benchmark executables for comparison |
| 11 | +# Asio benchmark executable for comparison |
12 | 12 |
|
13 | | -# io_context benchmark (callbacks) |
14 | | -add_executable(asio_bench_io_context |
15 | | - io_context_bench.cpp) |
16 | | -target_link_libraries(asio_bench_io_context |
17 | | - PRIVATE |
18 | | - Boost::asio |
19 | | - Threads::Threads) |
20 | | -target_compile_features(asio_bench_io_context PUBLIC cxx_std_20) |
21 | | -target_compile_options(asio_bench_io_context |
22 | | - PRIVATE |
23 | | - $<$<CXX_COMPILER_ID:GNU>:-fcoroutines>) |
24 | | -set_property(TARGET asio_bench_io_context |
25 | | - PROPERTY FOLDER "benchmarks/asio") |
| 13 | +add_executable(asio_bench |
| 14 | + main.cpp |
| 15 | + io_context_bench.cpp |
| 16 | + socket_throughput_bench.cpp |
| 17 | + socket_latency_bench.cpp |
| 18 | + http_server_bench.cpp) |
26 | 19 |
|
27 | | -# io_context benchmark (coroutines - fair comparison with Corosio) |
28 | | -add_executable(asio_bench_io_context_coro |
29 | | - io_context_coro_bench.cpp) |
30 | | -target_link_libraries(asio_bench_io_context_coro |
| 20 | +target_link_libraries(asio_bench |
31 | 21 | PRIVATE |
32 | 22 | Boost::asio |
33 | 23 | Threads::Threads) |
34 | | -target_compile_features(asio_bench_io_context_coro PUBLIC cxx_std_20) |
35 | | -target_compile_options(asio_bench_io_context_coro |
36 | | - PRIVATE |
37 | | - $<$<CXX_COMPILER_ID:GNU>:-fcoroutines>) |
38 | | -set_property(TARGET asio_bench_io_context_coro |
39 | | - PROPERTY FOLDER "benchmarks/asio") |
40 | 24 |
|
41 | | -# socket throughput benchmark |
42 | | -add_executable(asio_bench_socket_throughput |
43 | | - socket_throughput_bench.cpp) |
44 | | -target_link_libraries(asio_bench_socket_throughput |
45 | | - PRIVATE |
46 | | - Boost::asio |
47 | | - Threads::Threads) |
48 | | -target_compile_features(asio_bench_socket_throughput PUBLIC cxx_std_20) |
49 | | -target_compile_options(asio_bench_socket_throughput |
50 | | - PRIVATE |
51 | | - $<$<CXX_COMPILER_ID:GNU>:-fcoroutines>) |
52 | | -set_property(TARGET asio_bench_socket_throughput |
53 | | - PROPERTY FOLDER "benchmarks/asio") |
| 25 | +target_compile_features(asio_bench PUBLIC cxx_std_20) |
54 | 26 |
|
55 | | -# socket latency benchmark |
56 | | -add_executable(asio_bench_socket_latency |
57 | | - socket_latency_bench.cpp) |
58 | | -target_link_libraries(asio_bench_socket_latency |
59 | | - PRIVATE |
60 | | - Boost::asio |
61 | | - Threads::Threads) |
62 | | -target_compile_features(asio_bench_socket_latency PUBLIC cxx_std_20) |
63 | | -target_compile_options(asio_bench_socket_latency |
| 27 | +target_compile_options(asio_bench |
64 | 28 | PRIVATE |
65 | 29 | $<$<CXX_COMPILER_ID:GNU>:-fcoroutines>) |
66 | | -set_property(TARGET asio_bench_socket_latency |
67 | | - PROPERTY FOLDER "benchmarks/asio") |
68 | 30 |
|
69 | | -# http server benchmark |
70 | | -add_executable(asio_bench_http_server |
71 | | - http_server_bench.cpp) |
72 | | -target_link_libraries(asio_bench_http_server |
73 | | - PRIVATE |
74 | | - Boost::asio |
75 | | - Threads::Threads) |
76 | | -target_compile_features(asio_bench_http_server PUBLIC cxx_std_20) |
77 | | -target_compile_options(asio_bench_http_server |
78 | | - PRIVATE |
79 | | - $<$<CXX_COMPILER_ID:GNU>:-fcoroutines>) |
80 | | -set_property(TARGET asio_bench_http_server |
81 | | - PROPERTY FOLDER "benchmarks/asio") |
| 31 | +set_property(TARGET asio_bench PROPERTY FOLDER "benchmarks/asio") |
| 32 | + |
| 33 | +if (COROSIO_BENCH_LTO_SUPPORTED) |
| 34 | + set_property(TARGET asio_bench PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) |
| 35 | +endif () |
0 commit comments