Skip to content

Avoid file read buffer copy - #606

Merged
SaladDay merged 1 commit into
aos/cutoverfrom
aos/avoid-file-read-buffer-copy
Oct 9, 2026
Merged

SaladDay merged 1 commit into
aos/cutoverfrom
aos/avoid-file-read-buffer-copy

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

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.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@SaladDay
SaladDay merged commit 10cad51 into aos/cutover Oct 9, 2026
19 of 20 checks passed
@SaladDay
SaladDay deleted the aos/avoid-file-read-buffer-copy branch October 9, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant