perf: batch io_uring submissions per poll - #8
Merged
Conversation
- io_uring_submit is no longer issued per operation; submitter.submit only registers the prepared SQEs and _poll flushes them all with a single io_uring_enter before waiting for completions. Previously every recv/send/accept paid its own syscall, which negates io_uring's batching advantage over epoll. - Raise DEFAULT_ENTRIES from 16 to 256; the submitter already flushes and retries if the queue fills up mid-batch. - Remove the unused *_nogil C wrappers: CFFI API-mode calls release the GIL around C calls already, so they were dead code. - Poll every 10ms instead of 100ms in the proactor e2e conftest, since operations now only make progress when _poll runs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bright2227
marked this pull request as ready for review
July 28, 2026 15:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
Submitting every prepared operation immediately caused an
io_uring_entersyscall per operation and did not safely handle partial submission progress.Impact
Normal event-loop iterations submit queued work with fewer syscalls while preserving correctness under queue pressure, interruptions, and partial submissions.
Validation
uv run pytest -q— 17 passeduv run ruff check uringloop testsgit diff --check main...HEAD