Skip to content

Commit bc2e92c

Browse files
authored
Merge branch 'cppalliance:develop' into fix-bind-throw
2 parents b2d4eca + e56eb71 commit bc2e92c

55 files changed

Lines changed: 6133 additions & 3510 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 184 additions & 186 deletions
Large diffs are not rendered by default.

‎bench/CMakeLists.txt‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,21 @@
88
# Official repository: https://github.com/cppalliance/corosio
99
#
1010

11+
# Check LTO support for benchmarks
12+
include(CheckIPOSupported)
13+
check_ipo_supported(RESULT COROSIO_BENCH_LTO_SUPPORTED OUTPUT COROSIO_BENCH_LTO_ERROR LANGUAGES CXX)
14+
if (COROSIO_BENCH_LTO_SUPPORTED)
15+
message(STATUS "LTO enabled for benchmarks")
16+
else ()
17+
message(STATUS "LTO not available for benchmarks: ${COROSIO_BENCH_LTO_ERROR}")
18+
endif ()
19+
1120
# Corosio benchmarks
1221
add_subdirectory(corosio)
1322

23+
# Profiler workloads (LTO disabled for call stack visibility)
24+
add_subdirectory(profile)
25+
1426
# Asio comparison benchmarks (only if Boost.Asio is available)
1527
if(TARGET Boost::asio)
1628
add_subdirectory(asio)

‎bench/asio/CMakeLists.txt‎

Lines changed: 15 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -8,74 +8,28 @@
88
# Official repository: https://github.com/cppalliance/corosio
99
#
1010

11-
# Asio benchmark executables for comparison
11+
# Asio benchmark executable for comparison
1212

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)
2619

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
3121
PRIVATE
3222
Boost::asio
3323
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")
4024

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)
5426

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
6428
PRIVATE
6529
$<$<CXX_COMPILER_ID:GNU>:-fcoroutines>)
66-
set_property(TARGET asio_bench_socket_latency
67-
PROPERTY FOLDER "benchmarks/asio")
6830

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 ()

‎bench/asio/benchmarks.hpp‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
//
2+
// Copyright (c) 2026 Steve Gerbino
3+
//
4+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
5+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6+
//
7+
// Official repository: https://github.com/cppalliance/corosio
8+
//
9+
10+
#ifndef ASIO_BENCH_BENCHMARKS_HPP
11+
#define ASIO_BENCH_BENCHMARKS_HPP
12+
13+
#include "../common/benchmark.hpp"
14+
15+
namespace asio_bench {
16+
17+
/** Run io_context benchmarks.
18+
19+
@param collector Results collector.
20+
@param filter Optional filter: nullptr or "all" runs all, or a specific
21+
benchmark name (single_threaded, multithreaded, interleaved, concurrent).
22+
*/
23+
void run_io_context_benchmarks(
24+
bench::result_collector& collector,
25+
char const* filter );
26+
27+
/** Run socket throughput benchmarks.
28+
29+
@param collector Results collector.
30+
@param filter Optional filter: nullptr or "all" runs all, or a specific
31+
benchmark name (unidirectional, bidirectional).
32+
*/
33+
void run_socket_throughput_benchmarks(
34+
bench::result_collector& collector,
35+
char const* filter );
36+
37+
/** Run socket latency benchmarks.
38+
39+
@param collector Results collector.
40+
@param filter Optional filter: nullptr or "all" runs all, or a specific
41+
benchmark name (pingpong, concurrent).
42+
*/
43+
void run_socket_latency_benchmarks(
44+
bench::result_collector& collector,
45+
char const* filter );
46+
47+
/** Run HTTP server benchmarks.
48+
49+
@param collector Results collector.
50+
@param filter Optional filter: nullptr or "all" runs all, or a specific
51+
benchmark name (single_conn, concurrent, multithread).
52+
*/
53+
void run_http_server_benchmarks(
54+
bench::result_collector& collector,
55+
char const* filter );
56+
57+
} // namespace asio_bench
58+
59+
#endif

0 commit comments

Comments
 (0)