Repository navigation
go: cut Rows' remaining per-call allocations (#456) - #464
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.
refs #456
#462 made the decoder allocation-light; this cuts what a full
Schema.Rowscall still allocated around it. Go only; scope isgo/chtypes/**,go/internal/abi1/take.goandgo/CHANGELOG.md. No exported name changes, no generated file edited, stockencoding/jsononly.Measured (darwin-arm64, Go 1.27.1, the reporter's call shape: 100 NDJSON rows,
tenant = {p:String}filter with params,WithExport(JSONCompactEachRow),WithDocFlags(0), a fresh four-key settings map each call)Schema.RowsAllocation sites, from
-memprofile -memprofilerate 1,alloc_space/alloc_objects, per call:rowsresult slice ([]RowResult)TakeInto)json.Decoderbuffer growth (stock)row_spanslist is no longer read as one valueVerdictpointersPartitionIDpointer (allocated even when the row has none)InputSpanpointersrow_spansdecode ([]*spanDoc, reflect, growslice,spansOf)[]Spanthe result carriescallConfig, generatedBufhandlesSafety
TakeIntocopies, andTestDecodeBatchOwnsItsMemoryoverwrites the document buffer after decoding and compares.Rowsoutput is identical to go: allocation-light Rows decoding (#456) #462's acrossdoc_flags0, 1, 2, 3, 7, 15, 31, 255, body sizes 0, 1, 7, 100, 300 and a malformed body (30 cases, JSON-hashed, run against both trees with the real library; local, not in CI).TestDecodeBatchEquivalence*stay and gain a third real document (a filtered call, withrow_spans,rows_passedandrows_cut) and 14row_spansmutations.go test -race ./chtypespasses (stub-driven concurrentRowstest in CI; a real-library 8-goroutineRowscheck under-racerun locally).Not in this PR: anything that needs an ABI or library change (the generated
Bufwrappers and their finalizers, the[]RowResultshape, the stock decoder's own buffer growth).🤖 Generated with Claude Code