Reduce stage log Put allocation overhead#7027
Open
rootp1 wants to merge 1 commit into
Open
Conversation
Signed-off-by: rootp1 <arnav.iitr@gmail.com>
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.
Summary
Putoverhead by encoding log blocks directly into the final buffer instead of allocating a[]byteper blockEOLmarkerLinked Issue
Fixes #7026
What Changed
json.Marshalplusbuf.Writewith a singlejson.Encoderwriting into the destination bufferTestFileStorePutto verify persisted output remains backward compatibleBenchmarkStageLogFileStorePutto capture the allocation and latency improvement against the legacy implementationVerification
go test ./pkg/app/server/stagelogstore— passedgo test -run '^$' -bench BenchmarkStageLogFileStorePut -benchmem ./pkg/app/server/stagelogstore— passedmake build/go— passedmake check/gen/code— passedmake check— failed:yarnis not installed in this environment, sobuild/webcould not runmake lint/go— failed: the pinnedgolangci-lintimage is built with Go 1.25, but the repository targets Go 1.26.2make test/go— failed: unrelated pre-existing repository test failures inpkg/app/piped/executor/kubernetesand Darwin tool tests inpkg/app/piped/platformprovider/kubernetesmake check/dco— failed: upstream history on this branch contains commit25ae69937e55e8330bff96c34346718f3e5e7148withoutSigned-off-by, and rewriting shared upstream history is not safeScope
pkg/app/server/stagelogstoreimplementation and tests were changed; unrelated files were not modifiedWhat this PR does:
Reduces allocation overhead in stage-log filestore persistence and adds regression coverage for the persisted format and benchmarked write path.
Why we need it:
The existing
Putpath rebuilt the full payload with per-blockjson.Marshalallocations on every write. This keeps the format the same while lowering per-write allocation cost.Which issue(s) this PR fixes:
Fixes #7026
Does this PR introduce a user-facing change?: