Skip to content

Bench (lockless/warmup)#236

Merged
sgerbino merged 2 commits intocppalliance:developfrom
sgerbino:pr/bench-cleanup
Apr 20, 2026
Merged

Bench (lockless/warmup)#236
sgerbino merged 2 commits intocppalliance:developfrom
sgerbino:pr/bench-cleanup

Conversation

@sgerbino
Copy link
Copy Markdown
Collaborator

No description provided.

…arison

Add _lockless variants to asio and asio_callback across socket_throughput,
socket_latency, local_socket_throughput, local_socket_latency, fan_out,
accept_churn, http_server, and timer, mirroring corosio's single-threaded
configurations by constructing the io_context with
BOOST_ASIO_CONCURRENCY_HINT_UNSAFE. Follows the existing pattern in
io_context_bench.cpp.

Move throughput byte accounting out of the read loop into a local int64_t
accumulator, calling state.add_bytes once after ioc.run() returns. The
previous per-read state.add_bytes was an atomic fetch_add on every
completion, which added ~20ns × N_reads to the measured elapsed time and
structurally disadvantaged the faster library at small chunk sizes.
Multithread benches still use atomic aggregation (required for correctness
across N runner threads).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (26)
  • perf/bench/asio/callback/accept_churn_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/callback/fan_out_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/callback/http_server_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/callback/io_context_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/callback/local_socket_latency_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/callback/local_socket_throughput_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/callback/socket_latency_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/callback/socket_throughput_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/callback/timer_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/coroutine/accept_churn_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/coroutine/fan_out_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/coroutine/http_server_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/coroutine/io_context_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/coroutine/local_socket_latency_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/coroutine/local_socket_throughput_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/coroutine/socket_latency_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/coroutine/socket_throughput_bench.cpp is excluded by !**/bench/**
  • perf/bench/asio/coroutine/timer_bench.cpp is excluded by !**/bench/**
  • perf/bench/common/suite.hpp is excluded by !**/bench/**
  • perf/bench/corosio/http_server_bench.cpp is excluded by !**/bench/**
  • perf/bench/corosio/io_context_bench.cpp is excluded by !**/bench/**
  • perf/bench/corosio/local_socket_latency_bench.cpp is excluded by !**/bench/**
  • perf/bench/corosio/local_socket_throughput_bench.cpp is excluded by !**/bench/**
  • perf/bench/corosio/socket_latency_bench.cpp is excluded by !**/bench/**
  • perf/bench/corosio/socket_throughput_bench.cpp is excluded by !**/bench/**
  • perf/bench/main.cpp is excluded by !**/bench/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0763e90f-c649-4b22-8859-4bc5e7892cfd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cppalliance-bot
Copy link
Copy Markdown

cppalliance-bot commented Apr 20, 2026

An automated preview of the documentation is available at https://236.corosio.prtest3.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-04-20 15:42:36 UTC

@cppalliance-bot
Copy link
Copy Markdown

cppalliance-bot commented Apr 20, 2026

GCOVR code coverage report https://236.corosio.prtest3.cppalliance.org/gcovr/index.html
LCOV code coverage report https://236.corosio.prtest3.cppalliance.org/genhtml/index.html
Coverage Diff Report https://236.corosio.prtest3.cppalliance.org/diff-report/index.html

Build time: 2026-04-20 15:51:31 UTC

Add --warmup <secs> flag (default 0, disabled) that runs every benchmark
once with a throwaway state before the real measurement. The self-warmup
exercises the exact code path being measured, eliminating the sync-vs-async
warmup asymmetry in the previous scheme where corosio's set_warmup lambdas
exercised async I/O paths while asio's used synchronous asio::write/read.

Removes benchmark_suite::set_warmup and all 18 .set_warmup([]{...}) call
sites across corosio, asio coroutine, and asio callback. For benches with
needs_conntrack_drain, drain runs before both warmup and real measurement.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.71%. Comparing base (3fc8c97) to head (c596fb4).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #236   +/-   ##
========================================
  Coverage    77.71%   77.71%           
========================================
  Files           96       96           
  Lines         7298     7298           
  Branches      1787     1787           
========================================
  Hits          5672     5672           
  Misses        1108     1108           
  Partials       518      518           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fc8c97...c596fb4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sgerbino sgerbino merged commit e49d180 into cppalliance:develop Apr 20, 2026
42 checks passed
@sgerbino sgerbino deleted the pr/bench-cleanup branch April 20, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants