Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions perf/bench/asio/callback/accept_churn_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ bench::benchmark_result bench_sequential_churn( double duration_s )
{
perf::print_header( "Sequential Accept Churn (Asio Callbacks)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
tcp_acceptor acc( ioc.get_executor(), tcp::endpoint( tcp::v4(), 0 ) );
acc.set_option( tcp_acceptor::reuse_address( true ) );
auto ep = tcp::endpoint( asio::ip::address_v4::loopback(), acc.local_endpoint().port() );
Expand Down Expand Up @@ -177,7 +177,7 @@ bench::benchmark_result bench_concurrent_churn( int num_loops, double duration_s
{
std::cout << " Concurrent loops: " << num_loops << "\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
std::atomic<bool> running{ true };
std::vector<int64_t> cycle_counts( num_loops, 0 );
std::vector<perf::statistics> stats( num_loops );
Expand Down Expand Up @@ -325,7 +325,7 @@ bench::benchmark_result bench_burst_churn( int burst_size, double duration_s )
{
std::cout << " Burst size: " << burst_size << "\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
tcp_acceptor acc( ioc.get_executor(), tcp::endpoint( tcp::v4(), 0 ) );
acc.set_option( tcp_acceptor::reuse_address( true ) );
auto ep = tcp::endpoint( asio::ip::address_v4::loopback(), acc.local_endpoint().port() );
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/callback/fan_out_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ bench::benchmark_result bench_fork_join( int fan_out, double duration_s )
{
std::cout << " Fan-out: " << fan_out << "\n";

asio::io_context ioc;
asio::io_context ioc( 1 );

std::vector<tcp_socket> clients;
std::vector<tcp_socket> servers;
Expand Down Expand Up @@ -331,7 +331,7 @@ bench::benchmark_result bench_nested(
std::cout << " Groups: " << groups << ", Subs/group: "
<< subs_per_group << " (total " << total_subs << ")\n";

asio::io_context ioc;
asio::io_context ioc( 1 );

std::vector<tcp_socket> clients;
std::vector<tcp_socket> servers;
Expand Down Expand Up @@ -402,7 +402,7 @@ bench::benchmark_result bench_concurrent_parents(
<< fan_out << "\n";

int total_subs = num_parents * fan_out;
asio::io_context ioc;
asio::io_context ioc( 1 );

std::vector<tcp_socket> clients;
std::vector<tcp_socket> servers;
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/callback/http_server_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ bench::benchmark_result bench_single_connection( double duration_s )
{
perf::print_header( "Single Connection (Asio Callbacks)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
auto [client, server] = asio_bench::make_socket_pair( ioc );

std::atomic<bool> running{ true };
Expand Down Expand Up @@ -220,7 +220,7 @@ bench::benchmark_result bench_concurrent_connections( int num_connections, doubl
{
std::cout << " Connections: " << num_connections << "\n";

asio::io_context ioc;
asio::io_context ioc( 1 );

std::vector<tcp_socket> clients;
std::vector<tcp_socket> servers;
Expand Down Expand Up @@ -416,7 +416,7 @@ void run_http_server_benchmarks(

// Warm up
{
asio::io_context ioc;
asio::io_context ioc( 1 );
auto [c, s] = asio_bench::make_socket_pair( ioc );
char buf[256] = {};
for( int i = 0; i < 10; ++i )
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/callback/io_context_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bench::benchmark_result bench_single_threaded_post( double duration_s )
{
perf::print_header( "Single-threaded Handler Post (Asio Callbacks)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
int64_t counter = 0;
int constexpr batch_size = 1000;

Expand Down Expand Up @@ -145,7 +145,7 @@ bench::benchmark_result bench_interleaved_post_run( double duration_s, int handl
{
perf::print_header( "Interleaved Post/Run (Asio Callbacks)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
int64_t counter = 0;

perf::stopwatch sw;
Expand Down Expand Up @@ -249,7 +249,7 @@ void run_io_context_benchmarks(

// Warm up
{
asio::io_context ioc;
asio::io_context ioc( 1 );
int64_t counter = 0;
for( int i = 0; i < 1000; ++i )
asio::post( ioc, [&counter] { ++counter; } );
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/callback/socket_latency_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ bench::benchmark_result bench_pingpong_latency( std::size_t message_size, double
{
std::cout << " Message size: " << message_size << " bytes\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
auto [client, server] = asio_bench::make_socket_pair( ioc );

std::atomic<bool> running{ true };
Expand Down Expand Up @@ -170,7 +170,7 @@ bench::benchmark_result bench_concurrent_latency(
std::cout << " Concurrent pairs: " << num_pairs << ", ";
std::cout << "Message size: " << message_size << " bytes\n";

asio::io_context ioc;
asio::io_context ioc( 1 );

std::vector<tcp_socket> clients;
std::vector<tcp_socket> servers;
Expand Down Expand Up @@ -256,7 +256,7 @@ void run_socket_latency_benchmarks(

// Warm up
{
asio::io_context ioc;
asio::io_context ioc( 1 );
auto [c, s] = asio_bench::make_socket_pair( ioc );
char buf[64] = {};
for( int i = 0; i < 100; ++i )
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/callback/socket_throughput_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ bench::benchmark_result bench_throughput( std::size_t chunk_size, double duratio
{
std::cout << " Buffer size: " << chunk_size << " bytes\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
auto [writer, reader] = asio_bench::make_socket_pair( ioc );

std::vector<char> write_buf( chunk_size, 'x' );
Expand Down Expand Up @@ -133,7 +133,7 @@ bench::benchmark_result bench_bidirectional_throughput( std::size_t chunk_size,
{
std::cout << " Buffer size: " << chunk_size << " bytes, bidirectional\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
auto [sock1, sock2] = asio_bench::make_socket_pair( ioc );

std::vector<char> buf1( chunk_size, 'a' );
Expand Down Expand Up @@ -205,7 +205,7 @@ void run_socket_throughput_benchmarks(

// Warm up
{
asio::io_context ioc;
asio::io_context ioc( 1 );
auto [w, r] = asio_bench::make_socket_pair( ioc );
std::vector<char> buf( 4096, 'w' );
asio::write( w, asio::buffer( buf ) );
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/callback/timer_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bench::benchmark_result bench_schedule_cancel( double duration_s )
{
perf::print_header( "Timer Schedule/Cancel (Asio Callbacks)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
int64_t counter = 0;
int constexpr batch_size = 1000;

Expand Down Expand Up @@ -107,7 +107,7 @@ bench::benchmark_result bench_fire_rate( double duration_s )
{
perf::print_header( "Timer Fire Rate (Asio Callbacks)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
std::atomic<bool> running{ true };
int64_t counter = 0;

Expand Down Expand Up @@ -189,7 +189,7 @@ bench::benchmark_result bench_concurrent_timers( int num_timers, double duration
{
std::cout << " Timers: " << num_timers << "\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
std::atomic<bool> running{ true };
std::vector<int64_t> fire_counts( num_timers, 0 );
std::vector<perf::statistics> stats( num_timers );
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/coroutine/accept_churn_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bench::benchmark_result bench_sequential_churn( double duration_s )
{
perf::print_header( "Sequential Accept Churn (Asio Coroutines)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
tcp_acceptor acc( ioc.get_executor(), tcp::endpoint( tcp::v4(), 0 ) );
acc.set_option( tcp_acceptor::reuse_address( true ) );
auto ep = tcp::endpoint( asio::ip::address_v4::loopback(), acc.local_endpoint().port() );
Expand Down Expand Up @@ -132,7 +132,7 @@ bench::benchmark_result bench_concurrent_churn( int num_loops, double duration_s
{
std::cout << " Concurrent loops: " << num_loops << "\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
std::atomic<bool> running{ true };
std::vector<int64_t> cycle_counts( num_loops, 0 );
std::vector<perf::statistics> stats( num_loops );
Expand Down Expand Up @@ -249,7 +249,7 @@ bench::benchmark_result bench_burst_churn( int burst_size, double duration_s )
{
std::cout << " Burst size: " << burst_size << "\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
tcp_acceptor acc( ioc.get_executor(), tcp::endpoint( tcp::v4(), 0 ) );
acc.set_option( tcp_acceptor::reuse_address( true ) );
auto ep = tcp::endpoint( asio::ip::address_v4::loopback(), acc.local_endpoint().port() );
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/coroutine/fan_out_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bench::benchmark_result bench_fork_join( int fan_out, double duration_s )
{
std::cout << " Fan-out: " << fan_out << "\n";

asio::io_context ioc;
asio::io_context ioc( 1 );

std::vector<tcp_socket> clients;
std::vector<tcp_socket> servers;
Expand Down Expand Up @@ -171,7 +171,7 @@ bench::benchmark_result bench_nested(
std::cout << " Groups: " << groups << ", Subs/group: "
<< subs_per_group << " (total " << total_subs << ")\n";

asio::io_context ioc;
asio::io_context ioc( 1 );

std::vector<tcp_socket> clients;
std::vector<tcp_socket> servers;
Expand Down Expand Up @@ -294,7 +294,7 @@ bench::benchmark_result bench_concurrent_parents(
<< fan_out << "\n";

int total_subs = num_parents * fan_out;
asio::io_context ioc;
asio::io_context ioc( 1 );

std::vector<tcp_socket> clients;
std::vector<tcp_socket> servers;
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/coroutine/http_server_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ bench::benchmark_result bench_single_connection( double duration_s )
{
perf::print_header( "Single Connection (Asio Coroutines)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
auto [client, server] = make_socket_pair( ioc );

std::atomic<bool> running{ true };
Expand Down Expand Up @@ -180,7 +180,7 @@ bench::benchmark_result bench_concurrent_connections( int num_connections, doubl
{
std::cout << " Connections: " << num_connections << "\n";

asio::io_context ioc;
asio::io_context ioc( 1 );

std::vector<tcp_socket> clients;
std::vector<tcp_socket> servers;
Expand Down Expand Up @@ -366,7 +366,7 @@ void run_http_server_benchmarks(

// Warm up
{
asio::io_context ioc;
asio::io_context ioc( 1 );
auto [c, s] = make_socket_pair( ioc );
char buf[256] = {};
for( int i = 0; i < 10; ++i )
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/coroutine/io_context_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bench::benchmark_result bench_single_threaded_post( double duration_s )
{
perf::print_header( "Single-threaded Handler Post (Asio Coroutines)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
int64_t counter = 0;
int constexpr batch_size = 1000;

Expand Down Expand Up @@ -156,7 +156,7 @@ bench::benchmark_result bench_interleaved_post_run( double duration_s, int handl
{
perf::print_header( "Interleaved Post/Run (Asio Coroutines)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
int64_t counter = 0;

perf::stopwatch sw;
Expand Down Expand Up @@ -258,7 +258,7 @@ void run_io_context_benchmarks(

// Warm up
{
asio::io_context ioc;
asio::io_context ioc( 1 );
int64_t counter = 0;
for( int i = 0; i < 1000; ++i )
asio::co_spawn( ioc, increment_task( counter ), asio::detached );
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/coroutine/socket_latency_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ bench::benchmark_result bench_pingpong_latency( std::size_t message_size, double
{
std::cout << " Message size: " << message_size << " bytes\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
auto [client, server] = make_socket_pair( ioc );

std::atomic<bool> running{ true };
Expand Down Expand Up @@ -122,7 +122,7 @@ bench::benchmark_result bench_concurrent_latency(
std::cout << " Concurrent pairs: " << num_pairs << ", ";
std::cout << "Message size: " << message_size << " bytes\n";

asio::io_context ioc;
asio::io_context ioc( 1 );

std::vector<tcp_socket> clients;
std::vector<tcp_socket> servers;
Expand Down Expand Up @@ -206,7 +206,7 @@ void run_socket_latency_benchmarks(

// Warm up
{
asio::io_context ioc;
asio::io_context ioc( 1 );
auto [c, s] = make_socket_pair( ioc );
char buf[64] = {};
for( int i = 0; i < 100; ++i )
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/coroutine/socket_throughput_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bench::benchmark_result bench_throughput( std::size_t chunk_size, double duratio
{
std::cout << " Buffer size: " << chunk_size << " bytes\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
auto [writer, reader] = make_socket_pair( ioc );

std::vector<char> write_buf( chunk_size, 'x' );
Expand Down Expand Up @@ -117,7 +117,7 @@ bench::benchmark_result bench_bidirectional_throughput( std::size_t chunk_size,
{
std::cout << " Buffer size: " << chunk_size << " bytes, bidirectional\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
auto [sock1, sock2] = make_socket_pair( ioc );

std::vector<char> buf1( chunk_size, 'a' );
Expand Down Expand Up @@ -245,7 +245,7 @@ void run_socket_throughput_benchmarks(

// Warm up
{
asio::io_context ioc;
asio::io_context ioc( 1 );
auto [w, r] = make_socket_pair( ioc );
std::vector<char> buf( 4096, 'w' );
asio::write( w, asio::buffer( buf ) );
Expand Down
6 changes: 3 additions & 3 deletions perf/bench/asio/coroutine/timer_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bench::benchmark_result bench_schedule_cancel( double duration_s )
{
perf::print_header( "Timer Schedule/Cancel (Asio Coroutines)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
int64_t counter = 0;
int constexpr batch_size = 1000;

Expand Down Expand Up @@ -82,7 +82,7 @@ bench::benchmark_result bench_fire_rate( double duration_s )
{
perf::print_header( "Timer Fire Rate (Asio Coroutines)" );

asio::io_context ioc;
asio::io_context ioc( 1 );
std::atomic<bool> running{ true };
int64_t counter = 0;

Expand Down Expand Up @@ -136,7 +136,7 @@ bench::benchmark_result bench_concurrent_timers( int num_timers, double duration
{
std::cout << " Timers: " << num_timers << "\n";

asio::io_context ioc;
asio::io_context ioc( 1 );
std::atomic<bool> running{ true };
std::vector<int64_t> fire_counts( num_timers, 0 );
std::vector<perf::statistics> stats( num_timers );
Expand Down
Loading
Loading