Repository navigation
perf(tape): pwrite/pread in StdIo (#52 step 2a) - #54
Merged
Merged
Conversation
Each write_at was seek + write_all: 2 syscalls and no positional IO. Unix now uses FileExt::write_all_at and read_at. Non-unix keeps the seek path. No caller relies on the file cursor. Refs #52 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Oct 24, 2026
Contributor
Author
|
A/B (details on #52): +0.6% / +1.1% / +1.0% at 16/64/128 writers. perf confirms 642k write+lseek become 642k pwrite64. Small but free. Marking ready. |
There was a problem hiding this comment.
🔵 Needs a closer look
The draft’s required Azure A/B measurements are still pending, so throughput gains and latency regressions need validation before approval.
No open issues 🎉
What changed in this PR
This PR reduces syscall overhead in StdIo as part of #52’s writer-throughput work, without changing write placement or partial-failure handling.
Changes:
- Uses Unix positional I/O for complete writes and single reads, avoiding a separate seek.
- Preserves locking and the seek-based fallback on non-Unix platforms.
- Leaves write coalescing out of scope; performance measurements remain pending.
| File | Description |
|---|---|
crates/zerodb-tape/src/io.rs |
Adds Unix FileExt read/write paths and conditionally imports fallback I/O traits. |
Review effort: Balanced
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.
Step 2a of #52.
StdIo::write_atdidseek+write_all. That's 2 syscalls per request, about 160 per group of 80. On unix it now callsFileExt::write_all_at(pwrite).read_atusespread. Non-unix keeps the seek path.No semantic change. Placement and partial-failure handling are untouched. Nothing else in the crate reads or moves the file cursor.
Coalescing a group into 1 write (step 2b) is not in this PR. It changes partial-failure acks and needs its own tests. It's deferred, because halving syscalls here gains only about 1%.
Measured
Azure L8s v3, main
8a66c83against this PRf98b082. Systems ran interleaved in shuffled order in one VM session, with Redis as a control, 5 reps. Ratios are medians of per-rep throughput ratios to main.perf staton the writer thread at 128 writers and 640k appends: 641,771write+ 641,771lseekbecome 641,771pwrite64.A small but free gain, with no regression on either disk. The Premium SSD v2 64-writer runs were noisy for every system. Full data is in #56 and on #52.
Validation
-D warnings, debug and release tests, both sims, fault-inject and Python client tests.