persist: skip lgalloc memcpy in S3 get path#36305
Merged
antiguru merged 1 commit intoMaterializeInc:mainfrom Apr 28, 2026
Merged
persist: skip lgalloc memcpy in S3 get path#36305antiguru merged 1 commit intoMaterializeInc:mainfrom
antiguru merged 1 commit intoMaterializeInc:mainfrom
Conversation
The S3 get path copied every chunk fetched from the SDK into a
freshly-allocated `MetricsRegion<u8>`. With lgalloc disabled in practice
the region falls back to the heap, so the copy is pure overhead. Push
SDK `Bytes` straight into `SegmentedBytes` instead.
Removes the `persist_enable_s3_lgalloc_{cc,noncc}_sizes` dyncfgs, the
unused `cfg`/`is_cc_active` fields on `S3BlobConfig`/`S3Blob`, and the
now-dead `LgBytesMetrics::persist_s3` field.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
Author
|
We should do the same for other parts, too, like azure and arrow. |
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.
The S3 get path copied each
Byteschunk returned by the SDK into a freshly-allocatedMetricsRegion<u8>.With lgalloc disabled in practice that region falls back to the heap, making the copy pure overhead.
Push SDK
Bytesstraight intoSegmentedBytesinstead.Also removes the now-unused
persist_enable_s3_lgalloc_{cc,noncc}_sizesdyncfgs, thecfg/is_cc_activefields onS3BlobConfig/S3Blob, and the deadLgBytesMetrics::persist_s3metric.Motivation
Reduces CPU and allocator pressure on every S3 read in persist.
Tips for reviewer
The behavior change is in
Blob::getinsrc/persist/src/s3.rs; everything else is dead-code removal that follows.Checklist
$T ⇔ Proto$Tmapping (possibly in a backwards-incompatible way), then it is tagged with aT-protolabel.