Skip to content

Scheduler changes - #203

Merged
lalinsky merged 4 commits into
mainfrom
scheduler-changes
Jan 15, 2026
Merged

lalinsky merged 4 commits into
mainfrom
scheduler-changes

Conversation

@lalinsky

Copy link
Copy Markdown
Owner

No description provided.

Add inflight_io counter to track I/O operations submitted to the backend.
When running in no_wait mode with no pending I/O, skip the epoll_wait/
io_uring_enter/etc syscall entirely since there's nothing to retrieve.

This reduces syscall overhead for CPU-bound workloads that use no_wait
polling between task batches.
- Rename Rust benchmarks to explicitly indicate runtime (tokio, may)
- Add May coroutine library benchmarks for comparison
- Add run.sh script for running benchmarks
- Rename Zig benchmark targets for consistency
- Update .gitignore for benchmark build artifacts
After running 61 tasks, getNextTask() returns null to force an event
loop tick. This ensures I/O completions are checked periodically even
under heavy CPU-bound workloads. The value 61 comes from Go's scheduler.
@coderabbitai

coderabbitai Bot commented Jan 15, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR restructures benchmarks to support Tokio and May async runtimes, removes per-message latency tracking from benchmark code across Go/Rust/Zig, integrates a benchmark runner script, increases benchmark iteration counts by 10x, and refactors I/O completion handling with backend-specific finalization and task-scheduling optimizations in the event loop.

Changes

Cohort / File(s) Summary
Benchmark Infrastructure & Binary Setup
.gitignore, benchmarks/Cargo.toml, build.zig
Added entries for benchmark artifacts; renamed Cargo package and binary targets (e.g., ping_pong → ping_pong_tokio, echo_server → echo_server_tokio); removed echo_server_multi; added may and num_cpus dependencies; renamed Zig benchmark executable names.
Latency Tracking Removal
benchmarks/echo_server.go, benchmarks/echo_server.zig, benchmarks/echo_server_tokio.rs, benchmarks/ping_pong_current_thread.rs
Removed per-message latency measurement, Timer tracking, and percentile calculations; simplified function signatures (clientTask, handle_client); enabled TCP no-delay on clients; deleted ping_pong_current_thread.rs entirely.
New May-Based Benchmarks
benchmarks/echo_server_may.rs, benchmarks/ping_pong_may.rs
Added May coroutine-based echo server and ping-pong benchmarks with worker configuration, connection handling, and throughput metrics.
Benchmark Load Adjustments & Automation
benchmarks/ping_pong.go, benchmarks/ping_pong.zig, benchmarks/ping_pong_tokio.rs, benchmarks/run.sh
Increased NUM_ROUNDS by 10x (1M → 10M); changed Zig executor configuration; added comprehensive Bash script to build and run cross-language benchmarks with configurable repetitions.
Backend Completion Refactoring
src/ev/backends/epoll.zig, src/ev/backends/io_uring.zig, src/ev/backends/iocp.zig, src/ev/backends/kqueue.zig, src/ev/backends/poll.zig
Replaced all state.markCompleted(...) calls with state.markCompletedFromBackend(...) across error paths, synchronous operations, and completion handlers.
Event Loop State & Completion Management
src/ev/loop.zig
Added inflight_io field to track pending I/O; introduced markCompletedFromBackend() method; modified tick polling logic to poll when wait is true or inflight I/O exists.
Task Scheduling & Migration
src/runtime.zig, src/runtime/task.zig
Added tick_task_count and EVENT_INTERVAL (61) to enforce I/O processing cadence; reset counter after ticks; updated AnyTask.canMigrate() to permit migration when unpinned and not canceled.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

Green coroutines join the dance with Tokio's steady beat,
Latency records fade away—just throughput, clean and neat. 🎯
Five backends sing in unison, inflight I/O takes its course,
Tasks yield on schedule now, with timely, graceful force. ⚡

🚥 Pre-merge checks | ❌ 3
❌ Failed checks (1 warning, 2 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Scheduler changes' is vague and doesn't convey what specifically changed. The actual changes span benchmarks, event loop state tracking, task migration logic, and I/O handling across multiple files. Provide a more specific title that captures the main change, such as 'Add inflight I/O tracking and task migration support' or 'Implement event loop I/O responsiveness improvements'.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess relevance to the changeset. Add a description explaining the purpose of these changes, key modifications to event loop handling, and any performance or behavioral implications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch scheduler-changes

🧹 Recent nitpick comments
benchmarks/run.sh (2)

19-22: Loop variable i unused - harmless but fixable.

The shellcheck warning about i being unused is technically correct. If you want to silence it, you can use _ as the variable name instead. That said, this is purely cosmetic and doesn't affect execution.

-for i in $(seq 1 $RUNS); do
+for _ in $(seq 1 $RUNS); do

Alternatively, bash 3+ supports brace expansion: for _ in {1..$RUNS} won't work (variables don't expand in braces), but you could use a C-style loop if you really cared. Honestly, this is fine as-is.


20-21: grep will exit non-zero if pattern not found, killing the script.

With set -e, if the benchmark output format ever changes and "Time per round" isn't printed, grep returns 1 and the whole script dies. Consider adding || true or using grep -o with a fallback if you want more resilience:

-    ./zig-out/bin/ping_pong_benchmark 2>&1 | grep "Time per round"
+    ./zig-out/bin/ping_pong_benchmark 2>&1 | grep "Time per round" || echo "Pattern not found"

Same applies to all other grep calls (lines 27, 34, 41, 50, 57, 64, 71). Up to you whether this matters for a benchmark script.


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 793dfbf and 4ff5256.

⛔ Files ignored due to path filters (1)
  • benchmarks/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (22)
  • .gitignore
  • benchmarks/Cargo.toml
  • benchmarks/echo_server.go
  • benchmarks/echo_server.rs
  • benchmarks/echo_server.zig
  • benchmarks/echo_server_may.rs
  • benchmarks/echo_server_tokio.rs
  • benchmarks/ping_pong.go
  • benchmarks/ping_pong.zig
  • benchmarks/ping_pong_current_thread.rs
  • benchmarks/ping_pong_may.rs
  • benchmarks/ping_pong_tokio.rs
  • benchmarks/run.sh
  • build.zig
  • src/ev/backends/epoll.zig
  • src/ev/backends/io_uring.zig
  • src/ev/backends/iocp.zig
  • src/ev/backends/kqueue.zig
  • src/ev/backends/poll.zig
  • src/ev/loop.zig
  • src/runtime.zig
  • src/runtime/task.zig
💤 Files with no reviewable changes (2)
  • benchmarks/ping_pong_current_thread.rs
  • benchmarks/echo_server.rs
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2025-11-04T10:29:56.949Z
Learnt from: lalinsky
Repo: lalinsky/zio PR: 118
File: src/core/task.zig:33-115
Timestamp: 2025-11-04T10:29:56.949Z
Learning: In zio's task implementation (src/core/task.zig), the Closure struct intentionally caps result_len and context_len at 4096 bytes (using u12 fields) and alignment at 16 bytes (using u4 padding fields). This is a deliberate design decision to avoid bloating task structures. Users needing larger result or context storage should heap-allocate and pass pointers instead. These limits are more generous than std lib's fixed storage (64 bytes for results, 1024 bytes for args).
<!-- [add_learning]
The task storage limits in zio (4 KiB for result/context, 16-byte alignment) are intentional design constraints to prevent task bloat, not correctness issues. The maintainer's position is that larger data should be heap-allocated.

Applied to files:

  • src/runtime/task.zig
  • src/runtime.zig
📚 Learning: 2026-01-10T13:55:00.163Z
Learnt from: lalinsky
Repo: lalinsky/zio PR: 184
File: src/runtime/blocking_task.zig:117-146
Timestamp: 2026-01-10T13:55:00.163Z
Learning: In Zig files, do not reference libxev for async I/O. The project uses a custom event loop implementation under src/ev/ and a callback-based async I/O loop similar to libuv/libxev. Reviewers should ensure code relies on the src/ev event loop and that there are no libxev usage patterns; prefer the central event loop in src/ev/ for all asynchronous operations.

Applied to files:

  • src/runtime/task.zig
  • src/runtime.zig
  • build.zig
  • src/ev/backends/io_uring.zig
  • src/ev/loop.zig
  • src/ev/backends/iocp.zig
  • benchmarks/echo_server.zig
  • src/ev/backends/epoll.zig
  • src/ev/backends/kqueue.zig
  • src/ev/backends/poll.zig
  • benchmarks/ping_pong.zig
📚 Learning: 2026-01-10T14:08:37.019Z
Learnt from: lalinsky
Repo: lalinsky/zio PR: 184
File: src/stdio.zig:117-129
Timestamp: 2026-01-10T14:08:37.019Z
Learning: In Zig files implementing swap-like semantics (e.g., old = swap(new); defer swap(old)), ensure the return value is an opaque restoration token rather than a direct reflection of internal state. Rely on the contract to perform increment/decrement logic internally (e.g., shield_count) and not expose internal state through the token. This makes behavior predictable, supports refactoring, and avoids leaking internal state across calls. Apply this pattern broadly to Zig code that uses a paired-swap or restoration-token mechanism.

Applied to files:

  • src/runtime/task.zig
  • src/runtime.zig
  • build.zig
  • src/ev/backends/io_uring.zig
  • src/ev/loop.zig
  • src/ev/backends/iocp.zig
  • benchmarks/echo_server.zig
  • src/ev/backends/epoll.zig
  • src/ev/backends/kqueue.zig
  • src/ev/backends/poll.zig
  • benchmarks/ping_pong.zig
📚 Learning: 2026-01-08T21:08:29.444Z
Learnt from: CR
Repo: lalinsky/zio PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-08T21:08:29.444Z
Learning: Release process: Update version in build.zig.zon

Applied to files:

  • build.zig
📚 Learning: 2026-01-08T21:08:29.443Z
Learnt from: CR
Repo: lalinsky/zio PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-08T21:08:29.443Z
Learning: Use `./check.sh --full` before committing to also build examples and benchmarks

Applied to files:

  • build.zig
  • benchmarks/run.sh
📚 Learning: 2025-10-10T05:59:17.087Z
Learnt from: lalinsky
Repo: lalinsky/zio PR: 41
File: src/udp.zig:79-82
Timestamp: 2025-10-10T05:59:17.087Z
Learning: In UDP socket operations (src/udp.zig), error.Canceled from result_data.result represents OS/IO-level cancellation (e.g., io_uring), not user-requested cancellation. User cancellation is handled by waitForXevCompletion() via try. OS-level error.Canceled should be mapped to error.Unexpected as it represents an unexpected system event.

Applied to files:

  • src/ev/backends/io_uring.zig
  • src/ev/backends/iocp.zig
  • src/ev/backends/epoll.zig
🧬 Code graph analysis (3)
benchmarks/echo_server_may.rs (1)
benchmarks/echo_server.go (4)
  • NUM_CLIENTS (12-12)
  • MESSAGES_PER_CLIENT (13-13)
  • MESSAGE_SIZE (14-14)
  • SERVER_ADDR (15-15)
benchmarks/ping_pong_tokio.rs (1)
benchmarks/ping_pong.rs (3)
  • main (29-61)
  • pinger (6-15)
  • ponger (17-26)
benchmarks/ping_pong_may.rs (2)
benchmarks/ping_pong.go (1)
  • NUM_ROUNDS (8-8)
benchmarks/ping_pong_tokio.rs (3)
  • pinger (6-15)
  • ponger (17-26)
  • main (29-61)
🪛 Shellcheck (0.11.0)
benchmarks/run.sh

[warning] 70-70: i appears unused. Verify use (or export if used externally).

(SC2034)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test (windows-latest)
🔇 Additional comments (55)
.gitignore (1)

5-9: LGTM!

Clean additions for benchmark build artifacts. The patterns correctly target Cargo's output directory and the Go binary outputs.

src/runtime/task.zig (1)

211-215: LGTM!

The migration logic is correct: tasks can migrate only when not pinned and not canceled. The .acquire ordering on the canceled_status read ensures visibility of any cancellation set by another thread before migration proceeds.

src/runtime.zig (4)

318-322: Good scheduler fairness mechanism.

The tick_task_count field with EVENT_INTERVAL = 61 is a solid approach borrowed from Go's runtime scheduler. Prime numbers reduce resonance with periodic workloads. The TODO about adding a time-based limit (10ms) is worth tracking - it would help when tasks yield frequently but don't hit the count limit.


657-666: Solid I/O starvation prevention.

Returning null after 61 tasks forces the event loop to process I/O completions. This is the right place to enforce the limit - before any queue is consulted.


641-642: Counter reset placement is correct.

Resetting after loop.run() ensures the counter reflects tasks run between I/O processing cycles. The counter accurately measures how long I/O has been starved.


678-678: Both task selection paths increment the counter.

LIFO slot path (line 678) and ready_queue path (lines 695) both increment tick_task_count. The LIFO starvation path (lines 684-688) correctly doesn't increment since it just moves the task to ready_queue without running it.

Also applies to: 693-696

src/ev/backends/epoll.zig (4)

179-179: Consistent completion path in addToPollQueue.

Error paths in addToPollQueue now correctly use markCompletedFromBackend. This ensures proper bookkeeping for the new inflight_io tracking in LoopState.

Also applies to: 198-198, 225-225


303-322: Synchronous operations use the backend completion path.

All immediate-completion operations (net_open, net_bind, net_listen, net_close, net_shutdown) consistently use markCompletedFromBackend. The pattern is uniform across all sync paths.


325-341: Connect paths properly finalized.

Both immediate success (line 330) and error (line 338) paths in net_connect use markCompletedFromBackend. The async path via addToPollQueue will complete through the poll handler.


401-401: Cancel and poll completion paths updated.

The cancel function (line 401) and the poll completion handler (line 439) both use the new method. This ensures all completion paths through the epoll backend are unified.

Also applies to: 439-439

src/ev/backends/iocp.zig (6)

344-389: Synchronous operations in IOCP use backend completion path.

All immediate operations (net_open with IOCP association, net_bind, net_listen, net_close, net_shutdown) correctly use markCompletedFromBackend. The net_open path handles both success and IOCP association failure cases.


391-445: Async operation error paths unified.

Error handling in async submit functions (net_connect, net_accept, net_recv, net_send, etc.) all use markCompletedFromBackend for immediate failure cases. The pattern is consistent.


598-598: Async submission failures correctly finalized.

AcceptEx, poll, recv, send, recvfrom, sendto, and ConnectEx all handle non-IO_PENDING errors by calling markCompletedFromBackend. This ensures the completion callback gets invoked even for immediate failures.

Also applies to: 648-648, 686-686, 723-723, 762-762, 801-801, 869-869


1116-1161: processCompletion handlers updated for net_connect and net_accept.

Both completion handlers now use markCompletedFromBackend. The net_accept path has an early return at line 1202 for extension loading failure, which correctly calls the new method before returning.


1246-1361: Network I/O completions unified.

All network operation completions (net_recv, net_send, net_recvfrom, net_sendto, net_poll) use markCompletedFromBackend consistently.


1363-1461: File I/O completions unified.

File operations (file_read, file_write, file_stream_read, file_stream_write) and the fallback error case all use markCompletedFromBackend. The IOCP backend is now fully aligned with the new completion finalization API.

src/ev/backends/poll.zig (6)

166-178: Consistent inflight_io decrement on error paths.

Both error paths in addToPollQueue now correctly use markCompletedFromBackend to decrement the inflight_io counter that was incremented when the completion was submitted via Loop.add(). The pattern is solid.


258-276: Synchronous ops now route through markCompletedFromBackend.

These immediate completions (net_open, net_bind, net_listen, net_close, net_shutdown) correctly use the new method. Since inflight_io gets bumped in Loop.add() before submit() is called, decrementing here keeps the counter accurate even for sync operations.


280-296: net_connect paths correctly finalized.

Both the immediate-connect success path (line 285) and the error path (line 293) use markCompletedFromBackend. The WouldBlock/ConnectionPending case correctly queues via addToPollQueue without immediate completion.


325-351: Windows file_stream error handling aligned.

All three file_stream operations (read, write, poll) correctly complete via markCompletedFromBackend on Windows where they're unsupported. This ensures inflight_io stays balanced.


360-374: Cancel completion path updated.

When cancellation successfully removes a target from the poll queue, the target is completed with error.Canceled via markCompletedFromBackend. This correctly decrements the target's inflight_io contribution.


411-420: Poll completion path finalized correctly.

When checkCompletion returns .completed, the completion is removed from the queue and finalized via markCompletedFromBackend. Spurious wakeups (.requeue) correctly stay in the queue without touching the counter.

src/ev/loop.zig (3)

109-127: Clean inflight_io tracking mechanism.

The counter increments in Loop.add() before backend submission and decrements in markCompletedFromBackend(). The separation keeps the accounting centralized. One invariant to maintain: every inflight_io += 1 must have exactly one corresponding markCompletedFromBackend call, or you'll underflow on line 125.


503-504: Increment before submit is the right spot.

Bumping inflight_io here guarantees the counter reflects submitted work even if backend.submit() completes synchronously and calls markCompletedFromBackend before returning.


710-713: Syscall elision for CPU-bound workloads.

Skipping backend.poll() when wait=false and inflight_io=0 avoids unnecessary kernel transitions. The comment explains the intent well. This is a practical win for tight loops that only need timer/async processing.

src/ev/backends/io_uring.zig (3)

191-200: Synchronous ops finalized via backend path.

These immediate operations (net_open, net_bind, net_listen) correctly use markCompletedFromBackend to balance the inflight_io increment from Loop.add().


203-213: SQE failure paths handle accounting.

When getSqe fails, the completion is immediately finalized with error.Unexpected via markCompletedFromBackend. This pattern repeats across all async operations and keeps the inflight_io counter balanced.


809-810: Poll completion path documented and correct.

The comment clarifies that markCompletedFromBackend handles the inflight_io decrement. Good documentation of the contract.

src/ev/backends/kqueue.zig (5)

166-182: queueRegister error handling aligned.

When reserving a kevent change slot fails, the completion is finalized via markCompletedFromBackend. This keeps inflight_io balanced even on resource exhaustion.


230-250: Synchronous operations use backend completion path.

All immediate completions (net_open, net_bind, net_listen, net_close, net_shutdown) route through markCompletedFromBackend. Consistent with other backends.


252-269: net_connect branches handled correctly.

Immediate success (line 258) and error (line 266) paths both use markCompletedFromBackend. The async path via queueRegister defers completion until poll.


326-330: Cancel completion finalization updated.

When cancellation successfully queues an unregister, the target is completed via markCompletedFromBackend.


386-396: Poll completion path uses backend method.

Completed events call markCompletedFromBackend. Spurious wakeups (.requeue) re-register without touching the counter.

benchmarks/ping_pong.zig (2)

7-7: 10x iteration increase for better signal.

Bumping from 1M to 10M rounds reduces noise and gives more stable throughput measurements. Matches the changes in the Go and Tokio variants mentioned in the PR.


30-30: Remove this review concern—num_executors = 0 is intentional.

The code shows that num_executors = 0 triggers auto-detection via std.Thread.getCpuCount() (falling back to 1 if detection fails), not single-threaded mode. Setting it to 0 actually makes the benchmark multi-threaded and CPU-aware, which is more realistic than the previous single-threaded mode (1 executor). Both ping_pong.zig and echo_server.zig use this pattern, indicating it's deliberate to measure performance with available parallelism rather than in isolation.

Likely an incorrect or invalid review comment.

benchmarks/ping_pong.go (1)

8-8: LGTM!

10x bump to NUM_ROUNDS is consistent with the other benchmark variants in this PR. More iterations means more stable timing measurements and less noise from startup overhead.

benchmarks/ping_pong_tokio.rs (1)

4-4: LGTM!

Consistent 10x increase to match the Go and other Rust variants. The benchmark structure is solid.

benchmarks/ping_pong_may.rs (2)

1-52: Good addition to the benchmark suite.

The May variant correctly uses the go! macro for coroutine spawning and follows the same measurement methodology as the Tokio/Go variants. Worker count configuration via num_cpus::get() is a reasonable default.


24-25: Channel design difference affects benchmark comparability.

may::sync::mpsc::channel() creates unbounded channels, while Tokio uses mpsc::channel(1) and Go uses make(chan uint32, 1) — both bounded with capacity 1. This means May's benchmark operates without backpressure, making it fundamentally different from the other two. May's API doesn't expose a capacity parameter, so this is a library design constraint rather than a configuration choice.

The May variant still measures what it's meant to measure (May's ping-pong throughput), just on different footing than Tokio/Go. Keep this in mind when comparing results.

benchmarks/Cargo.toml (2)

11-25: Binary targets are well-organized.

Clear 1:1 mapping between binary names and source files. The _tokio and _may suffixes make it obvious which runtime each benchmark uses.


2-9: Package rename and new dependencies check out.

Renaming to "benchmarks" makes sense—you've got ping_pong and echo_server variants for both Tokio and May here. The may (0.3.51) and num_cpus (1.16.0) dependencies are both real versions and align with what you're building.

build.zig (1)

61-64: Benchmark renaming looks fine.

The switch from kebab-case (ping-pong) to snake_case with _benchmark suffix works. The Zig benchmarks use _benchmark suffix while Rust uses runtime suffixes (_tokio, _may) - that's a reasonable distinction since Zig only has one implementation per benchmark type.

Make sure to run ./check.sh --full to verify the build picks these up correctly. Based on learnings from this repo.

benchmarks/run.sh (1)

1-13: Build and setup section looks solid.

Clean directory handling with $(dirname "$0")/.. and parameterized run counts. The parallel cargo build with --quiet is a nice touch to reduce noise.

benchmarks/echo_server_may.rs (4)

9-12: Constants align with other benchmarks.

Good to see consistent benchmark parameters across languages. The port (45682) is unique from Go (45679), Zig (45678), and Tokio (45681), avoiding conflicts when running tests in parallel.


14-27: Server-side handler is clean.

The read-until-EOF pattern is correct. One thing: you're not setting set_nodelay(true) on the server-side socket like the client does. Depending on your workload, Nagle's algorithm could batch small writes. Probably doesn't matter much for echo benchmarks, but worth noting.


102-104: std::process::exit(0) is a blunt instrument but acceptable here.

Since the server coroutine loops forever on listener.incoming(), there's no clean way to break out of the scope without this. For a benchmark harness, it's fine. In production code you'd want a shutdown signal, but this isn't production code.


80-80: Relaxed ordering is correct for this counter.

You just need the count to eventually be visible, no happens-before relationship required between clients. Ordering::Relaxed is the right call.

benchmarks/echo_server.go (2)

68-81: Clean simplification of clientTask.

Removing latency tracking makes sense if you're focusing on throughput metrics. The SetNoDelay(true) addition is the right move for request-response benchmarks where you want each write to go out immediately rather than waiting for Nagle's 40ms timer.

The type assertion to *net.TCPConn is safe here since net.Dial("tcp", ...) always returns a TCP connection.


133-136: Call site updated correctly.

The serverReady channel is already drained by the time goroutines spawn (after line 127's <-serverReady), so passing it here is essentially a no-op but harmless. It was likely kept for consistency with the wait pattern inside clientTask at line 71.

benchmarks/echo_server.zig (3)

27-27: reuse_address = true is a solid addition.

This prevents "address already in use" errors when quickly restarting benchmarks. The SO_REUSEADDR socket option lets you bind to a port that's still in TIME_WAIT state from a previous run. Essential for repeated benchmark execution.


45-55: Simplified clientTask signature and consistent socket tuning.

Removal of latencies and client_id parameters aligns with the throughput-focused metric changes across all language variants. The setNoDelay(true) call matches the Go and Rust implementations.


100-103: Spawn loop correctly updated for new signature.

The spawning now just passes rt and server_ready - clean and matches the new clientTask signature at line 45-48.

benchmarks/echo_server_tokio.rs (3)

53-57: client_task cleanup matches the pattern.

Removing latency tracking and adding set_nodelay(true) brings this in line with the Go, Zig, and May variants. The simplified signature makes the benchmark code easier to follow.


101-104: Loop variable renamed and spawn call simplified.

Using _ instead of i correctly reflects that the index is unused. The client_task(ready) call matches the new signature.


89-90: Barrier sizing is correct.

NUM_CLIENTS + 2 accounts for all clients, the server task, and main. The server_done barrier with count 2 (server and main) for shutdown coordination is also right.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

@lalinsky
lalinsky merged commit 0a7d9b9 into main Jan 15, 2026
@lalinsky
lalinsky deleted the scheduler-changes branch January 15, 2026 12:55
@coderabbitai coderabbitai Bot mentioned this pull request Jan 16, 2026
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.

1 participant