Repository navigation
perf(io): avoid fixed-buffer copies during submission - #29
Merged
thweetkomputer merged 1 commit intoNov 3, 2026
Merged
Conversation
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.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
Fixed-buffer reads and writes pass the 24-byte
FixedBufferdescriptor by value through Worker, StorageBackend and the selected backend. GCC retains repeated caller-side stack copies, including when storage uses SPDK. Pass the descriptor byconst&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:
Test configurations use
CMAKE_BUILD_TYPE=DebugandBYCORF_BUILD_EXAMPLES=OFF; the bypass build additionally usesBYCORF_KERNEL_BYPASS=ON. All 96 normal and 123 bypass-capable tests passed; formatting and whitespace checks passed.GCC 13.3/AArch64 static inspection at
-O3confirms the caller-side descriptor copies disappear in both configurations. Without LTO, the completeSizeIoAwaitable::await_suspendinstruction 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.