Sort line inputs before canonical ingest#185
Conversation
Greptile SummaryThis PR sorts line-like inputs before committing their canonical columns. 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: "Sort line inputs before canonical ingest" | Re-trigger Greptile |
Merging this PR will improve performance by 13.5%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_first_payload_line_unsorted_x |
27 ms | 23.8 ms | +13.5% |
| 🆕 | test_unsorted_line_ingest_medium |
N/A | 21.2 ms | N/A |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing agent/canonicalize-sorted-ingest (56a6065) with main (2a7d898)
Footnotes
-
1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩
Root cause
Line-like marks first canonicalized and committed unsorted x/y columns (including fused zone-map scans), then detected unsorted x, gathered stable-sorted copies, and committed those copies as new columns. The original canonical columns remained resident in the Figure's ColumnStore even though no trace referenced them. Area/error-band repeated the pattern across three columns.
That doubled long-lived canonical memory and repeated zone-map work for the common unsorted-input case.
Changes
Measured impact
100k random rows, 15 warmed construction repetitions:
Canonical residency is cut exactly in half. A separate 1M-row reversed-line probe improved from 2.753 ms to 2.204 ms (about 20%).
Verification
ty: passedgit diff --check: passedThe one known deselection is the current-main minified-bundle marker mismatch already fixed by #177. The Chromium full-path check passed separately outside the restricted sandbox.
Closes #170