Repository navigation
Avoid file read buffer copy - #606
Merged
Merged
Conversation
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.
Bounded file reads accumulated bytes as a string and then copied the full result into a byte slice. Use a standard-library byte buffer and return its owned bytes, preserving empty nonnil results, partial error results, size limits and handle/reference ownership. No RPC, cache, protocol or dependency is added.
Six alternating paired benchmarks through the actual File client/server show lower allocation for nonempty files: 4 KiB reads save about 4 KiB and one allocation; 1 MiB reads reduce allocated bytes from 9.29 MB to 5.59 MB and local median latency from 2.48 ms to 1.50 ms. Larger gains include buffer growth differences. Empty reads add 16 B/op; RPC counts are unchanged. These are local function/protocol results, not live Session speedup claims.
Validation: package tests including manifest coverage, six read-result semantics cases, race, vet, Runtime build and hygiene passed. Existing privileged-view tests were gated off. Coordinator reviewed the complete diff; same-source live qualification follows integration.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.