Add benchmark suite comparing Corosio and Asio performance#74
Add benchmark suite comparing Corosio and Asio performance#74sgerbino merged 1 commit intocppalliance:developfrom
Conversation
Implement comprehensive benchmarks for scheduler and socket I/O operations, with equivalent Asio implementations for fair comparison. Benchmarks added: - io_context: handler posting throughput, multi-threaded scaling - socket throughput: unidirectional and bidirectional transfer rates - socket latency: ping-pong round-trip times and concurrent connections Directory structure: bench/ ├── common/benchmark.hpp - Shared timing utilities and statistics ├── corosio/ - Corosio benchmarks using capy::task<> └── asio/ - Asio benchmarks using asio::awaitable<> Both benchmark suites use coroutines for apples-to-apples comparison. TCP_NODELAY is enabled on all sockets to ensure fair latency measurements. Also adds socket::native_handle() to expose the underlying file descriptor, enabling socket option configuration (e.g., TCP_NODELAY) from user code.
📝 WalkthroughWalkthroughThe pull request adds native socket handle access through a new platform-dependent public API. A Changes
Sequence DiagramsequenceDiagram
participant Client
participant socket
participant socket_impl
participant Platform as epoll/iocp<br/>Implementation
Client->>socket: native_handle()
socket->>socket_impl: Check if impl exists
alt impl is null
socket_impl-->>socket: Return invalid handle<br/>(~0ull or -1)
else impl exists
socket->>Platform: native_handle()
Platform->>Platform: Return platform-specific<br/>handle (fd_ or SOCKET)
Platform-->>socket: native_handle_type
end
socket-->>Client: native_handle_type
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
|
An automated preview of the documentation is available at https://74.corosio.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-01-23 19:48:06 UTC |
Implement comprehensive benchmarks for scheduler and socket I/O operations, with equivalent Asio implementations for fair comparison.
Benchmarks added:
Directory structure:
bench/
├── common/benchmark.hpp - Shared timing utilities and statistics
├── corosio/ - Corosio benchmarks using capy::task<>
└── asio/ - Asio benchmarks using asio::awaitable<>
Both benchmark suites use coroutines for apples-to-apples comparison. TCP_NODELAY is enabled on all sockets to ensure fair latency measurements.
Also adds socket::native_handle() to expose the underlying file descriptor, enabling socket option configuration (e.g., TCP_NODELAY) from user code.
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.