Skip to content

perf: optimize server I/O - #98

Merged
cvik merged 2 commits into
mainfrom
perf/io-optimizations
Oct 16, 2026
Merged

cvik merged 2 commits into
mainfrom
perf/io-optimizations

Conversation

@cvik

@cvik cvik commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Port the complete measured native I/O chain onto current main:

  • Cooperative io_uring task work and one pending tick timeout.
  • Shared provided-buffer descriptor ring, with receive ownership preserved and safe teardown.
  • Registered socket for receive/send.
  • Address-hash bucket index for completed exchanges, retaining existing cache/eviction/expiry policy.

Account for descriptor-ring locked memory, document the Linux 6.0 multishot-recvmsg floor, and add lifecycle/allocation/collision/model regression tests. Implementation and measurement limitations are in docs/IO_OPTIMIZATIONS.md; incremental benchmark gains are not additive.

No SINGLE_ISSUER/DEFER_TASKRUN, empty-submit skipping, CQE-clearing removal, or raw profiling archives are included.

Validation

With the released coapz v0.4.0 pin, zig build test and zig build test -Doptimize=ReleaseSafe each pass 214 tests. Normal and ReleaseFast builds pass. python3 bench/remote-smoke.py passes IPv4/IPv6 UDP/DTLS integration with two server workers and concurrent client windows, plus capacity/lease/rejection and duplicate/MID-wrap checks.

Released dependency

The follow-up dependency commit pins coapz v0.4.0, published after independent parser PR cvik/coapz#8 and release-preparation PR cvik/coapz#9 merged. The pin uses the release tag and Zig-verified package hash, not a temporary source commit.

The five I/O stages were measured with the original v0.3.0 dependency. Parser optimization gains are independent and are not attributed to those I/O changes.

@cvik
cvik merged commit 871c8a2 into main Oct 16, 2026
1 check passed
@cvik
cvik deleted the perf/io-optimizations branch October 16, 2026 00:31
@cvik cvik mentioned this pull request Oct 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