Skip to content

perf(io): avoid fixed-buffer copies during submission - #29

Merged
thweetkomputer merged 1 commit into
eloqdata:mainfrom
thweetkomputer:perf/fixed-buffer-submission
Nov 3, 2026
Merged

thweetkomputer merged 1 commit into
eloqdata:mainfrom
thweetkomputer:perf/fixed-buffer-submission

Conversation

@thweetkomputer

Copy link
Copy Markdown
Contributor

Fixed-buffer reads and writes pass the 24-byte FixedBuffer descriptor by value through Worker, StorageBackend and the selected backend. GCC retains repeated caller-side stack copies, including when storage uses SPDK. Pass the descriptor by const& throughout synchronous submission to remove those copies.

The descriptor is borrowed only until submission returns. io_uring retains its value-capturing preparation lambda and queues prepared SQEs; SPDK snapshots request fields into its pending requests. Neither backend queues the descriptor reference. Awaitables continue to own their descriptors by value, and data buffers and registrations must still survive through completion.

Add io_uring and SPDK stub regressions that reuse and clear the descriptor after submitting fixed reads/writes under backpressure. They verify the saved buffer address, size, offset, completion result and, for io_uring, a nonzero registered-buffer index.

Validation:

cmake --build build-testcases --parallel 4
ctest --test-dir build-testcases --output-on-failure
cmake --build build-testcases-bypass --parallel 4
ctest --test-dir build-testcases-bypass --output-on-failure
pre-commit run

Test configurations use CMAKE_BUILD_TYPE=Debug and BYCORF_BUILD_EXAMPLES=OFF; the bypass build additionally uses BYCORF_KERNEL_BYPASS=ON. All 96 normal and 123 bypass-capable tests passed; formatting and whitespace checks passed.

GCC 13.3/AArch64 static inspection at -O3 confirms the caller-side descriptor copies disappear in both configurations. Without LTO, the complete SizeIoAwaitable::await_suspend instruction count falls from 138 to 125 in the normal build and from 159 to 150 in the bypass-capable build. SPDK fixed-read/write callee counts remain unchanged; io_uring callees grow by two static instructions, so caller-only reductions are not total-path counts. In an isolated LTO link of actual storage/network/io_uring translation units, the storage await-suspend harness frame shrinks from 176 to 96 bytes. This is code-generation evidence, not a hardware throughput or latency measurement; SPDK LTO was not measured.

Ordinary calls, including temporary descriptors, remain source-compatible. The submission signatures and corresponding member-function-pointer types change, so dependent binaries must be rebuilt. Ownership, queue ordering and backend dispatch remain unchanged.

Borrow FixedBuffer through the submission facades and backends while preserving owned request parameters for queued I/O. Add io_uring and SPDK stub regressions that reuse the descriptor before completion.

Validated 96 normal and 123 bypass-capable tests. GCC 13 AArch64 assembly removes repeated caller-side descriptor stores; the isolated LTO storage await_suspend frame shrinks from 176 to 96 bytes. No hardware throughput claim.
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 48ad23b9-e6ea-495b-9760-b1c4757b933a
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@thweetkomputer
thweetkomputer merged commit ac35bac into eloqdata:main Nov 3, 2026
10 checks passed
@thweetkomputer
thweetkomputer deleted the perf/fixed-buffer-submission branch November 3, 2026 05:25
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