Deduplicate shared payload geometry columns - #183
Closed
Alek99 wants to merge 1 commit into
Closed
Conversation
Greptile SummaryThis PR deduplicates canonical geometry columns within each first-paint payload build. The main changes are:
Confidence Score: 5/5This looks safe to merge. No blocking issues found in the changed code.
What T-Rex did
Important Files Changed
Reviews (1): Last reviewed commit: "Deduplicate shared payload geometry colu..." | Re-trigger Greptile |
Merging this PR will not alter performance
Performance Changes
Comparing Footnotes
|
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.
Root cause
The column store already deduplicates canonical arrays at ingest, but every call to
_PayloadWriter.shipindependently offset-encoded and appended its geometry. K traces sharing one time/x column therefore emitted K byte-identical f32 columns and paid both K encodes and K × 4N wire bytes.Blind byte/value memoization would be unsafe: per-trace finite masks, log filtering, decimation, and other selections can produce different row mappings from the same source column.
Changes
values is col.values)The existing protocol already allows multiple trace fields to reference one column-table entry, so no client or wire-format change is needed.
Measured impact
16 direct traces × 150k points with one shared x and 16 distinct y columns; 15 warmed repetitions:
Both layouts reduce 16 distinct x references to one and save exactly 9,000,000 bytes, equal to
(K - 1) * 4N. The local medians show 29.1% lower packed assembly time and 17.8% lower split assembly time.Verification
ty: passedgit diff --check: passedThe one known adapter bundle-marker failure reproduces unchanged at
b0f8780; it is the minified-marker mismatch already fixed by #177.Closes #165