perf: create local writer for efficient local writes#5939
Merged
wjones127 merged 10 commits intolance-format:mainfrom Feb 16, 2026
Merged
perf: create local writer for efficient local writes#5939wjones127 merged 10 commits intolance-format:mainfrom
wjones127 merged 10 commits intolance-format:mainfrom
Conversation
Contributor
Author
|
This supersedes #5907. It maintains the same performance WRT memory and yields an incremental speedup. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
wjones127
approved these changes
Feb 16, 2026
wjones127
reviewed
Feb 16, 2026
Comment on lines
+578
to
+590
| temp_path.persist(&final_path).map_err(|e| { | ||
| Error::io( | ||
| format!("failed to persist temp file to {}: {}", final_path, e.error), | ||
| location!(), | ||
| ) | ||
| })?; | ||
|
|
||
| let metadata = std::fs::metadata(&final_path).map_err(|e| { | ||
| Error::io( | ||
| format!("failed to read metadata for {}: {}", self.path, e), | ||
| location!(), | ||
| ) | ||
| })?; |
Contributor
There was a problem hiding this comment.
I think these should be wrapped in a tokio::task::spawn_blocking() since they will both make blocking sys calls, right?
Contributor
Author
There was a problem hiding this comment.
thanks, updated + one more spot
This creates a new LocalWriter that wraps tokio::fs::File in a BufWriter for local file writes. ObjectStore::create() now returns one of these when working against local storage, and an ObjectWriter for remote storage. Prior to this commit, local writes (e.g for shuffling) went through a local object writer implementation that required a 5MB buffer per writer and also simulated multipart upload machinery. For local writing, this is slower than necessary and uses a lot of memory in situations where many writers are open at once. This change results in a substantial memory reduction and incremental speedup for IVF shuffle.
dca2234 to
f47a40e
Compare
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.

This creates a new LocalWriter that wraps tokio::fs::File in a BufWriter for local file writes. ObjectStore::create() now returns one of these when working against local storage, and an ObjectWriter for remote storage.
Prior to this commit, local writes (e.g for shuffling) went through a local object writer implementation that required a 5MB buffer per writer and also simulated multipart upload machinery. For local writing, this is slower than necessary and uses a lot of memory in situations where many writers are open at once.
This change results in a substantial memory reduction and incremental speedup for IVF shuffle.